1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
using System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Windows.Forms;
using
System.Collections;
using
System.Data.SqlClient;
namespace
projet
{
public partial class propriete : Form
{
parametres para = new parametres();
public propriete()
{
InitializeComponent();
}
public void ListeCycle(string LabelEtuve, string DbCy, string FinCy)
{
ArrayList propriety = new ArrayList();
ArrayList Quantity = new ArrayList();
try
{
Program.connexion.Open();
string mySelectQuery2 = "SELECT Matricule,Team,Nbr_Lot,Name,Quantity FROM Operation,Lots Where Operation.Oven_Label='" + LabelEtuve + "' and Operation.Start_Date Operation.Start_Date='" + DbCy + "' and Operation.End_Date ='" + FinCy + "'and Operation.Num=Lots.Num ";
Program.commande = new SqlCommand(mySelectQuery2, Program.connexion);
SqlDataReader myReader2 = Program.commande.ExecuteReader();
while (myReader2.Read())
{
for (int j = 0; j < myReader2.FieldCount; j += 1)
{
propriety.Add(myReader2[j].ToString());
}
Quantity.Add(propriety[3]);
Quantity.Add(propriety[4]);
}
myReader2.Close();
}
catch (Exception z) { MessageBox.Show(z.ToString()); }
Program.connexion.Close();
try
{
OvenLabel.Text = LabelEtuve;
OperatorMatricul.Text = propriety[0].ToString();
Team.Text = propriety[1].ToString();
StartCycle.Text = DbCy;
EndCycle.Text = FinCy;
int nbrLot = Convert.ToInt32(propriety[2]);
int l = 0;
listView1.Items.Clear();
ListViewItem[] it = new ListViewItem[nbrLot];
for (int i = 0; i < nbrLot; i++)
{
it[i] =
new ListViewItem();
it[i].Text = Quantity[l].ToString(); l++;
it[i].SubItems.Add(Quantity[l].ToString()); l++;
this.listView1.Items.Add(it[i]);
}
}
catch { }
}
private void propriete_Load(object sender, EventArgs e)
{
OvenLabel.Enabled =
false;
OperatorMatricul.Enabled =
false;
Team.Enabled =
false;
StartingTime.Enabled =
false;
StartCycle.Enabled =
false;
EndCycle.Enabled =
false;
}
private void close_Click(object sender, EventArgs e)
{
this.Close();
}
}
} |
Partager