Ejemplo n.º 1
0
        private void btnsave_Click(object sender, EventArgs e)
        {
            zuncan f = new zuncan();

            f.mode        = type_mode.mode.insert;
            f.FormClosed += new FormClosedEventHandler(f_FormClosed);
            f.MdiParent   = this.ParentForm;
            f.Show();
        }
Ejemplo n.º 2
0
        private void btnedit_Click(object sender, EventArgs e)
        {
            zuncanclass zc = new zuncanclass();
            DataTable   dt = new DataTable();
            zuncan      f  = new zuncan();

            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 = zc.Search(id);

                if (dt.Rows.Count > 0)
                {
                    f.txtid.Text       = dt.Rows[0]["id"].ToString();
                    f.txttitle.Text    = dt.Rows[0]["titles_in_zuncan"].ToString();
                    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("!این سطر حذف شده است، لطفا از دکمه بازآوری استفاده نمایید");
                }
            }
        }
Ejemplo n.º 3
0
 private void زونکنToolStripMenuItem_Click(object sender, EventArgs e)
 {
     UIL.zuncan f = new UIL.zuncan();
     f.MdiParent = this;
     f.Show();
 }