Exemplo n.º 1
0
 private void PopulateComboBoxes()
 {
     string macName = Properties.Settings.Default.machinename;
     DBConnect dbc = new DBConnect();
     ArrayList partNames = dbc.GetPartNames(macName,this.cat);
     ArrayList OperNames = dbc.GetOperationNames(macName);
     foreach (ComboBox cb in parts)
     {
         cb.Items.Clear();
         cb.Items.AddRange(partNames.ToArray());
     }
     foreach (ComboBox cb in opr)
     {
         cb.Items.Clear();
         cb.Items.AddRange(OperNames.ToArray());
     }
 }
Exemplo n.º 2
0
 private void PopulateOperation(object sender, EventArgs e)
 {
     ArrayList ops;
     DBConnect dbc = new DBConnect();
     ComboBox cb = (ComboBox)sender;
     string partNme = cb.Text;
     string macNme = Properties.Settings.Default.machinename;
     ops = dbc.GetOperationNames(macNme, partNme, appCat);
     ComboBox opBox = (ComboBox)partOps[sender];
     opBox.Items.Clear();
     opBox.Items.AddRange(ops.ToArray());
     string tblindx = cb.Name.Substring(1, 1);
     string rowindx = cb.Name.Substring(6, 1);
     string trgtname = "t" + tblindx + "trgt" + rowindx;
     Control[] trgtArr = this.Controls.Find(trgtname, true);
     TextBox trgt = trgtArr[0] as TextBox;
     trgt.Text = string.Empty;
 }