コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            FORM_ADD_PRODUCT frm = new FORM_ADD_PRODUCT();

            frm.ShowDialog();
            frm.txtRef.Focus();
        }
コード例 #2
0
        public FORM_ADD_PRODUCT()
        {
            InitializeComponent();

            if (frm == null) /*بعين قيمة لل form لو قيمتة ب null وهى تكون قيمتها الحالية  */            // .......[4]
            {
                frm = this;
            }

            cmbCategories.DataSource    = prd.GET_ALL_CATEGORIES();
            cmbCategories.DisplayMember = "CatName";
            cmbCategories.ValueMember   = "CatID";

            cmbCategories.SelectedIndex = -1;
            labeladd.Visible            = false;    // ل اخفاء ليبل حالة المنتج من الفرم
        }
コード例 #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            FORM_ADD_PRODUCT form = new FORM_ADD_PRODUCT();

            form.button1.Visible    = false;
            form.txtRef.Text        = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
            form.txtDes.Text        = this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
            form.txtqte.Text        = this.dataGridView1.CurrentRow.Cells[5].Value.ToString();
            form.txt_P_Price.Text   = this.dataGridView1.CurrentRow.Cells[3].Value.ToString();
            form.txt_S_price.Text   = this.dataGridView1.CurrentRow.Cells[4].Value.ToString();
            form.cmbCategories.Text = this.dataGridView1.CurrentRow.Cells[6].Value.ToString();
            form.Text            = "Product Update:" + this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
            form.btnAdd.Text     = "Update";
            form.state           = "update";
            form.txtRef.ReadOnly = true;
            form.ShowDialog();
        }
コード例 #4
0
        private void addANewProductToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FORM_ADD_PRODUCT frm = new FORM_ADD_PRODUCT();

            frm.ShowDialog();
        }
コード例 #5
0
        private static FORM_ADD_PRODUCT frm;                                          //  ......................[1]

        static void frm_formclosed(object sender, FormClosedEventArgs e)              //  ................[2]
        {
            frm = null;
        }