示例#1
0
        //events
        private void btn_Add_Click(object sender, EventArgs e)
        {
            AE_Product_Form ae_f = new AE_Product_Form(0);

            ae_f.D += new AE_Product_Form.MyDelegate(Load_dtgv);
            ae_f.ShowDialog();
            if (Product_dtgv.Rows.Count > 0)
            {
                Product_dtgv.Rows[Product_dtgv.Rows.Count - 1].Selected = true;
            }
        }
示例#2
0
        private void btn_Edit_Click(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection r = Product_dtgv.SelectedRows;

            if (r.Count == 1)
            {
                int             index = Product_dtgv.SelectedRows[0].Index;
                int             id    = Convert.ToInt32(Product_dtgv.SelectedRows[0].Cells["id"].Value);
                AE_Product_Form ae_f  = new AE_Product_Form(id);
                ae_f.D += new AE_Product_Form.MyDelegate(Load_dtgv);
                ae_f.ShowDialog();
                Product_dtgv.Rows[index].Selected = true;
            }
        }
示例#3
0
        private void btn_Add_Click(object sender, EventArgs e)
        {
            AE_Product_Form ae_f = new AE_Product_Form();

            ae_f.ShowDialog();
        }