private void cmddel_Click(object sender, EventArgs e) { if (dataGridView1.CurrentRow != null) { DialogResult dr; dr = MessageBox.Show("آیا از حذف کلاس اطمینان دارید؟", "حذف", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { int icol = 0; int irow = dataGridView1.CurrentRow.Index; string val = dataGridView1[icol, irow].Value.ToString(); classes cl = new classes(); cl.classno = long.Parse(val); cl.Delete(); if (btnfilter.Enabled == true) { btnfilter.PerformClick(); } else { DataTable dt = new DataTable(); dt = cl.Select(); dataGridView1.DataSource = dt; } } } }
private void button1_Click_1(object sender, EventArgs e) { if (dataGridView1.CurrentRow != null) { int col = 0; int row = dataGridView1.CurrentRow.Index; string val = dataGridView1[col, row].Value.ToString(); classes cl = new classes(); DataTable datat = new DataTable(); cl.classno = long.Parse(val); datat = cl.Selectforedit(); CloseClass ec = new CloseClass(); ec.txtclassno.Text = val; ec.cur_date = this.cur_date; ec.Search_Click(); ec.ShowDialog(); if (btnfilter.Enabled == true) { btnfilter.PerformClick(); } else { DataTable dt = new DataTable(); dt = cl.Select(); dataGridView1.DataSource = dt; } } }
private void FillDataSetAndView() { // Initialize a new instance of the DataSet object... classes cl = new classes(); datat = cl.Select(); // Set our CurrencyManager object // to the DataView object... objCurrencyManager = (CurrencyManager)(this.BindingContext[datat]); }
private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (txtteacher.Text == "" && txtartcourse.Text == "" && txtstdname.Text == "" && txtday.Text == "" && !txttimeFrom.MaskCompleted && !txttimeTo.MaskCompleted && !txtdateFrom.MaskCompleted && !txtdateTo.MaskCompleted && !checkBox1.Checked) { btnfilter.Enabled = false; classes cl = new classes(); DataTable dt = new DataTable(); dt = cl.Select(); dataGridView1.DataSource = dt; } else { btnfilter.Enabled = true; } }
private void cmdadd_Click(object sender, EventArgs e) { addclass ac = new addclass(); // ac.cur_date = this.cur_date; ac.ShowDialog(); if (btnfilter.Enabled == true) { btnfilter.PerformClick(); } else { classes cl = new classes(); DataTable dt = new DataTable(); dt = cl.Select(); dataGridView1.DataSource = dt; } }
private void btnOpenClass_Click(object sender, EventArgs e) { classes cl = new classes(); cl.classno = long.Parse(dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString().Trim()); cl.stdno = dataGridView1["stdno", dataGridView1.CurrentRow.Index].Value.ToString().Trim(); cl.UnCloseClass(); MessageBox.Show("عملیات بازسازی کلاس مورد نظر با موفقیت انجام شد"); if (btnfilter.Enabled == true) { btnfilter.PerformClick(); } else { DataTable dt = new DataTable(); dt = cl.Select(); dataGridView1.DataSource = dt; } }