Exemple #1
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();

                    hozoorclass gha = new hozoorclass();
                    gha.stdno   = grdDataViewer["stdno", irow].Value.ToString();
                    gha.classno = long.Parse(grdDataViewer["classno", irow].Value.ToString());
                    gha.date    = grdDataViewer["date", irow].Value.ToString();
                    gha.Delete();

                    if (btnfilter.Enabled == true)
                    {
                        btnfilter.PerformClick();
                    }
                    else
                    {
                        hozoorclass pm = new hozoorclass();
                        DataTable   dt = new DataTable();
                        dt = pm.Select();
                        grdDataViewer.DataSource = dt;
                    }
                }
            }
        }
Exemple #2
0
        private void btnedit_Click_1(object sender, EventArgs e)
        {
            if (grdDataViewer.CurrentRow != null)
            {
                int col  = 0;
                int irow = grdDataViewer.CurrentRow.Index;

                frmHozoorEdit fge = new frmHozoorEdit();

                fge.OLD_STDNO   = grdDataViewer["stdno", irow].Value.ToString();
                fge.OLD_CLASSNO = grdDataViewer["classno", irow].Value.ToString();
                fge.OLD_DATE    = grdDataViewer["date", irow].Value.ToString();
                fge.idsearch_Click();
                fge.ShowDialog();


                if (btnfilter.Enabled == true)
                {
                    btnfilter.PerformClick();
                }
                else
                {
                    hozoorclass pm = new hozoorclass();
                    DataTable   dt = new DataTable();
                    dt = pm.Select();
                    grdDataViewer.DataSource = dt;
                }
            }
        }
Exemple #3
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (txtartcourse.Text == "" && txtname.Text == "" && !txtmos_date.MaskCompleted && !txttodate.MaskCompleted && !checkBox1.Checked)
            {
                btnfilter.Enabled = false;

                hozoorclass pm = new hozoorclass();
                DataTable   dt = new DataTable();
                dt = pm.Select();
                grdDataViewer.DataSource = dt;
            }
            else
            {
                btnfilter.Enabled = true;
            }
        }
Exemple #4
0
        private void btnadd_Click(object sender, EventArgs e)
        {
            frmHozoorInp fgd = new frmHozoorInp();

            fgd.cur_date = this.cur_date;
            fgd.ShowDialog();

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