private void btnedit_Click_1(object sender, EventArgs e) { if (grdDataViewer.CurrentRow != null) { int col = 0; int row = grdDataViewer.CurrentRow.Index; string val = grdDataViewer[col, row].Value.ToString(); frmPaymentEslah fge = new frmPaymentEslah(); fge.txtid.Text = val; fge.idsearch_Click(); fge.ShowDialog(); if (btnfilter.Enabled == true) { btnfilter.PerformClick(); } else { payments pm = new payments(); DataTable dt = new DataTable(); dt = pm.Select(); grdDataViewer.DataSource = dt; } } }
private void btndel_Click_1(object sender, EventArgs e) { if (grdDataViewer.CurrentRow != null) { DialogResult dr; dr = MessageBox.Show("آیا از حذف این قبض اطمینان دارید؟", "حذف", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr == DialogResult.Yes) { int icol = 0; int irow = grdDataViewer.CurrentRow.Index; string val = grdDataViewer[icol, irow].Value.ToString(); payments gha = new payments(); gha.id = val; gha.Delete(); if (btnfilter.Enabled == true) { btnfilter.PerformClick(); } else { payments pm = new payments(); DataTable dt = new DataTable(); dt = pm.Select(); grdDataViewer.DataSource = dt; } } } }
private void TextChanged_Action(object sender, EventArgs e) { if (txtname.Text == "" && !txtmos_date.MaskCompleted && !txttodate.MaskCompleted && !checkBox1.Checked) { btnfilter.Enabled = false; payments pm = new payments(); DataTable dt = new DataTable(); dt = pm.Select(); grdDataViewer.DataSource = dt; } else { btnfilter.Enabled = true; } }
private void btnadd_Click(object sender, EventArgs e) { frmGhabzPardakht fgd = new frmGhabzPardakht(); //fgd.cur_date = this.cur_date; fgd.ShowDialog(); if (btnfilter.Enabled == true) { btnfilter.PerformClick(); } else { payments pm = new payments(); DataTable dt = new DataTable(); dt = pm.Select(); grdDataViewer.DataSource = dt; } }