private void Button1_Click(object sender, EventArgs e) { int id = Form5.id; DBconnectioncs s = new DBconnectioncs(); string dt_to = dateTimePicker1.Value.ToString("yyyy/MM/dd"); string dt_from = dateTimePicker2.Value.ToString("yyyy/MM/dd"); string query_connections = "select No_Of_Connections from Talent_acquisition_specialist where ID_TA = '" + id + "'"; DataTable conn = s.Select(query_connections); listBox1.Items.Clear(); listBox1.Items.Add(conn.Rows[0][0].ToString()); string query_signups = "select count(idStudent) from Student where signedup = 1 and ID_TAS = '" + id + "' and signup_date <= Cast('" + dt_to + "' as date) and signup_date>= Cast('" + dt_from + "' as date)"; DataTable name = s.Select(query_signups); listBox2.Items.Clear(); listBox2.Items.Add(name.Rows[0][0].ToString()); string urm = "select count(idStudent) from Student where signedup=1 and under_represented_minority=1 and ID_TAS = '" + id + "'and signup_date <= Cast('" + dt_to + "'as date) and signup_date> =Cast('" + dt_from + "'as date)"; DataTable urm_q = s.Select(urm); listBox3.Items.Clear(); listBox3.Items.Add((urm_q.Rows[0][0].ToString())); string dt = "select count(idStudent) from Student where ID_TAS ='" + id + "'and reply_date <= Cast('" + dt_to + "'as date) and reply_date> =Cast('" + dt_from + "'as date)"; DataTable date_q = s.Select(dt); listBox4.Items.Clear(); listBox4.Items.Add((date_q.Rows[0][0].ToString())); }
public void OK_Click(object sender, EventArgs e) { nm = TAS.SelectedItem.ToString(); DBconnectioncs s = new DBconnectioncs(); string dt_to = to.Value.ToString("yyyy/MM/dd"); string dt_from = from.Value.ToString("yyyy/MM/dd"); string query_connections = "select No_Of_Connections from Talent_acquisition_specialist where [Name] = '" + TAS.SelectedItem + "'"; DataTable name = s.Select(query_connections); connectionNumber.Items.Clear(); connectionNumber.Items.Add(name.Rows[0][0].ToString()); //HERE REPLY_DATE WILL BE CHANGED TO SIGNED UP DATE vvv string signedup = "select count(idStudent) from Student where signedup=1 and ID_TAS = (select ID_TA from Talent_acquisition_specialist where [Name] = '" + TAS.SelectedItem + "') and signup_date <= Cast('" + dt_to + "'as date) and signup_date>=Cast('" + dt_from + "'as date)"; DataTable signup_q = s.Select(signedup); signupsNumber.Items.Clear(); signupsNumber.Items.Add(signup_q.Rows[0][0].ToString()); string urm = "select sum(Under_represented_minority) from Student where signedup=1 and ID_TAS = (select ID_TA from Talent_acquisition_specialist where [Name] = '" + TAS.SelectedItem + "')and signup_date <= Cast('" + dt_to + "'as date) and signup_date> =Cast('" + dt_from + "'as date)"; DataTable urm_q = s.Select(urm); dsignup.Items.Clear(); dsignup.Items.Add((urm_q.Rows[0][0].ToString())); string dt = "select count(idStudent) from Student where ID_TAS =(select ID_TA from Talent_acquisition_specialist where [Name] = '" + TAS.SelectedItem + "')and reply_date <= Cast('" + dt_to + "'as date) and reply_date> =Cast('" + dt_from + "'as date)"; DataTable date_q = s.Select(dt); replies.Items.Clear(); replies.Items.Add((date_q.Rows[0][0].ToString())); //datagrid viewsig //[0][0] rows columns dataGridView1.Rows.Clear(); dataGridView1.Columns.Clear(); int g = int.Parse(signup_q.Rows[0][0].ToString()); dataGridView1.ColumnCount = 3; dataGridView1.Columns[0].Name = "Student name"; dataGridView1.Columns[1].Name = "Major"; dataGridView1.Columns[2].Name = "College"; //dataGridView1.Columns[3].Name = "Under Represented Minority"; string x = "select [Name],Major,University from Student where ID_TAS =(select ID_TA from Talent_acquisition_specialist where [Name] = '" + TAS.SelectedItem + "')"; DataTable query_student = s.Select(x); int a = 0; while (a != g) { string row = (query_student.Rows[a][0].ToString() + query_student.Rows[a][1].ToString() + query_student.Rows[a][2].ToString()); dataGridView1.Rows.Add(row); a++; } //row = new string[] { "4", "Product 4", "4000" }; //dataGridView1.Rows.Add(row); //string quer1 = "select " }
private void Performance_Load(object sender, EventArgs e) { DBconnectioncs d = new DBconnectioncs(); TAS.Items.Clear(); string query = "select ID_TA,[Name] from Talent_acquisition_specialist"; DataTable name = d.Select(query); for (int i = 0; i < name.Rows.Count; i++) { TAS.Items.Add(name.Rows[i]["name"].ToString()); //TAS.DisplayMember = "name"; //TAS.ValueMember = "ID_TA"; //TAS.DataSource = name; } }
private void Button1_Click(object sender, EventArgs e) { DBconnectioncs s = new DBconnectioncs(); int a = 0; string sup = "select T.[Name], count(idStudent) from Student, Talent_acquisition_specialist T where T.ID_TA = Student.ID_TAS group by T.[Name]"; chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1; while (a != 15) { DataTable signup_q = s.Select(sup); string x = signup_q.Rows[a][0].ToString(); string y = signup_q.Rows[a][1].ToString(); int g = 0; Int32.TryParse(y, out g); this.chart1.Series["Series1"].Points.AddXY(x, g); a++; } DBconnectioncs g1 = new DBconnectioncs(); //int = 0; string low = "select count(ID_TA) from Talent_acquisition_specialist where TAS_Status = 'LOW'"; string high = "select count(ID_TA) from Talent_acquisition_specialist where TAS_Status = 'STAR'"; string medium = "select count(ID_TA) from Talent_acquisition_specialist where TAS_Status = 'MEDIUM'"; chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1; DataTable l = g1.Select(low); DataTable h = g1.Select(high); DataTable m = g1.Select(medium); string lo = l.Rows[0][0].ToString(); string hi = h.Rows[0][0].ToString(); string me = m.Rows[0][0].ToString(); int x1 = 0; Int32.TryParse(lo, out x1); int y1 = 0; Int32.TryParse(hi, out y1); int z1 = 0; Int32.TryParse(me, out z1); this.chart2.Series["Series1"].Points.AddXY("Star Employees", x1); this.chart2.Series["Series1"].Points.AddXY("Medium grade", y1); this.chart2.Series["Series1"].Points.AddXY("Low performing", z1); }
private void Save_Click(object sender, EventArgs e) { DBconnectioncs s = new DBconnectioncs(); if (star.Checked) { string q = "update talent_acquisition_specialist set TAS_Status = 'STAR' where [Name] = '" + Performance.nm + "' "; s.Inserts(q); } if (medium.Checked) { string q = "update talent_acquisition_specialist set TAS_Status = 'MEDIUM' where [Name] = '" + Performance.nm + "' "; s.Inserts(q); } if (low.Checked) { string q = "update talent_acquisition_specialist set TAS_Status = 'LOW' where [Name] = '" + Performance.nm + "' "; s.Inserts(q); } this.Close(); }
private void Button1_Click(object sender, EventArgs e) { DBconnectioncs c = new DBconnectioncs(); int urm = 0; int sup = 0; if (checkBox1.Checked) { urm = 1; } if (checkBox2.Checked) { sup = 1; } if (sup == 1) { } //c.Inserts("insert Location (Name, City,country) values('" + comboBox2.SelectedItem + "','" + comboBox2.SelectedItem + "','" + comboBox1.SelectedItem + "')"); //int x= '" +c.Select("select Location_id from Location where Name='" + comboBox2.SelectedItem + "'")+ "'; c.Inserts("insert Student (Name, Major, email,university,Under_Represented_Minority,Graduationyear,signedup,reply_date) values ('" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "','" + comboBox3.Text + "','" + urm + "','" + textBox7.Text + "','" + sup + "',getdate())"); this.Close(); }
private void Button1_Click(object sender, EventArgs e) { groupBox1.Enabled = true; int id = Form5.id; DBconnectioncs s = new DBconnectioncs(); s.Inserts("update Talent_acquisition_specialist set no_of_connections=no_of_connections+'" + int.Parse(textBox1.Text) + "' where id_TA='" + id + "'"); string dt_to = dateTimePicker1.Value.ToString("yyyy/MM/dd"); string query_signups = "select count(idStudent) from Student where signedup = 1 and ID_TAS = '" + id + "' and signup_date <= Cast('" + dt_to + "' as date)"; DataTable name = s.Select(query_signups); listBox1.Items.Clear(); listBox1.Items.Add(name.Rows[0][0].ToString()); string dt = "select count(idStudent) from Student where ID_TAS ='" + id + "'and reply_date <= Cast('" + dt_to + "'as date)"; DataTable date_q = s.Select(dt); listBox2.Items.Clear(); listBox2.Items.Add((date_q.Rows[0][0].ToString())); }
private void Button1_Click_1(object sender, EventArgs e) { id = int.Parse(textBox1.Text); if (radioButton1.Checked) { DBconnectioncs LOL = new DBconnectioncs(); { string query = "select Manager_ID from Manager where Manager_ID = '" + textBox1.Text + "'"; string query2 = "select Password from Manager where Manager_ID = '" + textBox1.Text + "'and Password = '******'"; DataTable id = LOL.Select(query); DataTable pass = LOL.Select(query2); try { if (id.Rows[0][0] != null && pass.Rows[0][0] != null) { //this.Hide(); Performance form_ta = new Performance(); form_ta.Show(); } else { MessageBox.Show("Access Denied: ID Password not matched!"); } } catch { MessageBox.Show("Access Denied: ID Password not matched!"); } } } if (radioButton2.Checked) { DBconnectioncs LOL = new DBconnectioncs(); { string query = "select ID_TA from Talent_acquisition_specialist where ID_TA = '" + textBox1.Text + "'"; string query2 = "select Password from Talent_acquisition_specialist where ID_TA = '" + textBox1.Text + "'and Password = '******'"; DataTable id = LOL.Select(query); DataTable pass = LOL.Select(query2); try { if (id.Rows[0][0] != null && pass.Rows[0][0] != null) { groupBox3.Enabled = true; } else { MessageBox.Show("Access Denied: ID Password not matched!"); } } catch { MessageBox.Show("Access Denied: ID Password not matched!"); } } } }