private void cmdadd_Click(object sender, EventArgs e) { addstd as2 = new addstd(); //as2.cur_date = currentDate; as2.ShowDialog(); if (btnfilter.Enabled == true) { btnfilter.PerformClick(); } else { std st = new std(); DataTable dt = new DataTable(); dt = st.SelectForView(); dataGridView1.DataSource = dt; } }
private void btnstd_Click(object sender, EventArgs e) { int cmbPos = txtstdname.SelectedIndex; addstd ac = new addstd(); ac.ShowDialog(); std st = new std(); DataTable dtstdname = new DataTable(); dtstdname = st.Search("SELECT name, stdno FROM std order by name"); txtstdname.DataSource = dtstdname; txtstdname.DisplayMember = "name"; txtstdname.ValueMember = "name"; txtstdname.SelectedIndex = cmbPos; txtstdno.DataBindings.Clear(); txtstdno.DataBindings.Add("Text", dtstdname, "stdno"); }
private void toolStripButton3_Click(object sender, EventArgs e) { bool IsOpen = false; foreach (Form f in Application.OpenForms) { if (f.GetType() == typeof(addstd)) { IsOpen = true; f.Focus(); break; } } if (IsOpen == false) { addstd fmi = new addstd(); fmi.MdiParent = this; fmi.Show(); } }