private void button2_Click(object sender, EventArgs e) { string[] course = c_no.SelectedItem.ToString().Split(' '); var viewres = new frmdgview(tid, course[0], year.Text, semes.Text, field.Text, sec.Text, seattype.Text, seatst.Text, seatend.Text, maxth.Text, maxlab.Text); viewres.MdiParent = MdiParent; viewres.Dock = DockStyle.Right; //viewres.Width = (MdiParent.Width - 315); //viewres.Height = (MdiParent.Height - 15); viewres.Show(); Close(); }
private void button4_Click(object sender, EventArgs e) { string column = ""; if (fsearchas.Text == "Teacher ID") column = "tid"; if (fsearchas.Text == "Teacher Name") column = "t_name"; if (fsearchas.Text == "Faculty of") column = "f_of"; if (fsearchas.Text == "Qualification") column = "qualification"; if (fsearchas.Text == "Email") column = "email"; var resview = new frmdgview(database.dt_query("SELECT * FROM faculty WHERE " + column + " LIKE '%" + searchstrf.Text + "%'"), "faculty"); resview.MdiParent = MdiParent; resview.Show(); }
private void button1_Click(object sender, EventArgs e) { string column = ""; if (searchas.Text == "Student Name") column = "s_name"; if (searchas.Text == "Father Name") column = "f_name"; if (searchas.Text == "Year of Enrolment") column = "yoe"; if (searchas.Text == "Field") column = "field"; if (searchas.Text == "Semester") column = "semester"; if (searchas.Text == "Section") column = "sec"; var resview = new frmdgview(database.dt_query("SELECT * FROM student WHERE " + column + " LIKE '%" + searchstr.Text + "%'")); resview.MdiParent = MdiParent; resview.Show(); }
private void reslist_SelectedIndexChanged(object sender, EventArgs e) { int item = reslist.SelectedIndex; for (int i = Application.OpenForms.Count - 1; i >= 0; i--) { if (Application.OpenForms[i].Name == "frmviewres") Application.OpenForms[i].Close(); } if (item < 0) item = 0; string[] course = reslist.Items[item].ToString().Split(' '); var viewres = new frmdgview(course[0], course[2], course[4]); viewres.MdiParent = MdiParent; if (Application.OpenForms.Count == 2) viewres.Dock = DockStyle.Right; viewres.Width = (MdiParent.Width - 315); viewres.Height = (MdiParent.Height - 15); viewres.Show(); }