Пример #1
0
        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();

                frmGhabzEdit fge = new frmGhabzEdit();

                fge.txtid.Text = val;
                fge.stdno      = grdDataViewer["stdno", row].Value.ToString();
                fge.idsearch_Click();
                fge.ShowDialog();


                if (btnfilter.Enabled == true)
                {
                    btnfilter.PerformClick();
                }
                else
                {
                    ghabz     pm = new ghabz();
                    DataTable dt = new DataTable();
                    dt = pm.Select();
                    grdDataViewer.DataSource = dt;
                }
            }
        }
Пример #2
0
        private void TextChanged_Action(object sender, EventArgs e)
        {
            if (txtartcourse.Text == "" && txtname.Text == "" && !txtmos_date.MaskCompleted && !txttodate.MaskCompleted && !txtlastdatefrom.MaskCompleted && !txtlastdateto.MaskCompleted && !checkBox1.Checked)
            {
                btnfilter.Enabled = false;

                ghabz     pm = new ghabz();
                DataTable dt = new DataTable();
                dt = pm.Select();
                grdDataViewer.DataSource = dt;
            }
            else
            {
                btnfilter.Enabled = true;
            }
        }
Пример #3
0
        private void btnadd_Click(object sender, EventArgs e)
        {
            frmGhabzDaryaft fgd = new frmGhabzDaryaft();

            //fgd.cur_date = this.cur_date;
            //fgd.MdiParent = this.MdiParent;
            //int m = int.Parse(cur_date.Substring(5, 2));
            //fgd.txtlastcheck.SelectedIndex = m - 1;
            fgd.ShowDialog();

            if (btnfilter.Enabled == true)
            {
                btnfilter.PerformClick();
            }
            else
            {
                ghabz     pm = new ghabz();
                DataTable dt = new DataTable();
                dt = pm.Select();
                grdDataViewer.DataSource = dt;
            }
        }
Пример #4
0
        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();

                    ghabz gha = new ghabz();
                    gha.id = val;
                    gha.Delete();

                    std_history st = new std_history();
                    st.ghabz_id = val;
                    st.stdno    = grdDataViewer["stdno", irow].Value.ToString();
                    st.Delete();

                    if (btnfilter.Enabled == true)
                    {
                        btnfilter.PerformClick();
                    }
                    else
                    {
                        ghabz     pm = new ghabz();
                        DataTable dt = new DataTable();
                        dt = pm.Select();
                        grdDataViewer.DataSource = dt;
                    }
                }
            }
        }