Пример #1
0
 public void loadMachineNames()
 {
     DBConnect dbc = new DBConnect();
     ArrayList al = dbc.GetMachineNames();
     machineNames.Items.Clear();
     machineNames.Items.AddRange(al.ToArray());
     machineNames.Text = Properties.Settings.Default.machinename;
 }
Пример #2
0
 private bool TestDbConn()
 {
     DBConnect dbc = new DBConnect();
     if (dbc.TestConnection())
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Пример #3
0
 private void button3_Click(object sender, EventArgs e)
 {
     Properties.Settings.Default.username = dbuname.Text;
     Properties.Settings.Default.password = dbpwd.Text;
     Properties.Settings.Default.dbname = dbname.Text;
     Properties.Settings.Default.server = dbserver.Text;
     Properties.Settings.Default.dbport = dbport.Text;
     Properties.Settings.Default.Save();
     DBConnect dbc1 = new DBConnect();
     if (dbc1.TestConnection())
     {
         MessageBox.Show("DB Connection Successful! Settings Saved");
         loadMachineNames();
     }
     else
     {
         MessageBox.Show("DB Connection Failed!");
     }
 }
Пример #4
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());
     }
 }
Пример #5
0
 private void SetTarget(object sender, EventArgs e)
 {
     DBConnect dbc = new DBConnect();
     ComboBox cb = (ComboBox)sender;
     string tblindx = cb.Name.Substring(1, 1);
     string rowindx = cb.Name.Substring(5, 1);
     string partname = "t" + tblindx + "part" + rowindx;
     string trgtname = "t" + tblindx + "trgt" + rowindx;
     Control[] box = this.Controls.Find(partname,true);
     ComboBox prt = box[0] as ComboBox;
     Control[] trgtArr = this.Controls.Find(trgtname, true);
     TextBox trgt = trgtArr[0] as TextBox;
     string macName = Properties.Settings.Default.machinename;
     if (prt.Text != string.Empty && cb.Text != string.Empty)
     {
         trgt.Text = dbc.GetTarget(macName, prt.Text, cb.Text, appCat);
     }
 }
Пример #6
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;
 }