private void metroTextButton9_Click(object sender, EventArgs e) { sql s = new sql(this); s.addviolators(); s.loadviolators(); }
private void Form1_Load(object sender, EventArgs e) { sql s = new sql(this); s.loademployees(); s.loadviolationtb(); s.loadviolators(); }
private void metroTextButton8_Click(object sender, EventArgs e) { DataGridViewSelectedRowCollection selecteditems = violatorGRID.SelectedRows; ArrayList list = new ArrayList(selecteditems.Count); foreach (DataGridViewRow selecteditem in selecteditems) { list.Add(selecteditem.Cells["id"].Value.ToString()); } sql s = new sql(this); foreach (string x in list) { if (kryptonCheckBox5.Checked == true) { string str = "declare @empid as varchar(50) = (select id from employeetb where employee = '" + selectviolator.Text + "')" + "update violatorstb set empid = @empid where id = '" + x + "'"; s.updateviolator(str); } else { } if (kryptonCheckBox6.Checked == true) { string str = "declare @vioid as varchar(50)= (select id from violationtb where violation = '" + selectviolation.Text + "')" + "update violatorstb set vioid = @vioid where id = '" + x + "'"; s.updateviolator(str); } else { } if (kryptonCheckBox7.Checked == true) { string str = "update violatorstb set vdate = '" + vdate.Text + "' where id = '" + x + "'"; s.updateviolator(str); } else { } } kryptonCheckBox5.Checked = false; kryptonCheckBox6.Checked = false; kryptonCheckBox7.Checked = false; s.loadviolators(); }