示例#1
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            convention f = new convention();

            f.FormClosed += new FormClosedEventHandler(f_FormClosed);
            f.mode        = type_mode.mode.insert;
            f.MdiParent   = this.ParentForm;
            f.Show();
        }
示例#2
0
        private void btnedit_Click(object sender, EventArgs e)
        {
            conventionclass cc = new conventionclass();
            DataTable       dt = new DataTable();
            convention      f  = new convention();

            f.FormClosed += new FormClosedEventHandler(f_FormClosed);
            f.mode        = type_mode.mode.edit;

            if ((dataGridView1.Rows.Count == 0) || (dataGridView1.CurrentRow.Index == -1))
            {
                MessageBox.Show("سطری انتخاب نشده است");
                return;
            }

            int cr = dataGridView1.CurrentRow.Index;

            if (cr >= 0)
            {
                string id = dataGridView1[0, cr].Value.ToString();
                f.txtid.Enabled = false;
                dt = cc.Search(id);

                if (dt.Rows.Count > 0)
                {
                    f.txtid.Text      = dt.Rows[0]["id"].ToString();
                    f.txtsubject.Text = dt.Rows[0]["convention_subject"].ToString();
                    f.txtadviser.Text = dt.Rows[0]["project_adviser"].ToString();

                    f.txtyear.Text  = dt.Rows[0]["convention_date"].ToString().Substring(0, 4);
                    f.txtmonth.Text = dt.Rows[0]["convention_date"].ToString().Substring(5, 2);
                    f.txtday.Text   = dt.Rows[0]["convention_date"].ToString().Substring(8, 2);

                    f.txtplace.Text    = dt.Rows[0]["place_keeping"].ToString();
                    f.txtdescribe.Text = dt.Rows[0]["others_describetions"].ToString();

                    f.MdiParent = this.ParentForm;
                    f.Show();
                }
                else
                {
                    MessageBox.Show("!این سطر حذف شده است، لطفا از دکمه بازآوری استفاده نمایید");
                }
            }
        }
示例#3
0
 private void قراردادToolStripMenuItem_Click(object sender, EventArgs e)
 {
     UIL.convention f = new UIL.convention();
     f.MdiParent = this;
     f.Show();
 }