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

            frm.ShowDialog();
            DataView();
        }
コード例 #2
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            FrmAddSupplier.windowName = "اضافة مورد";
            FrmAddSupplier frm = new FrmAddSupplier();

            frm.ShowDialog();
            DataView();
        }
コード例 #3
0
        private void BtnEdit_Click(object sender, EventArgs e)
        {
            if (dgSupp.CurrentRow.Cells[1].Value.Equals("بدون مورد"))
            {
                MessageBox.Show("لا يمكن حذف هذا المورد", "Super market", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            FrmAddSupplier.windowName = "تعديل مورد";
            FrmAddSupplier frm = new FrmAddSupplier();

            try
            {
                frm.BtnNew.Visible      = false;
                frm.BtnAdd.Enabled      = true;
                frm.BtnAdd.Text         = "تعديل";
                frm.BtnAdd.Location     = new Point(333, 23);
                frm.BtnAdd.ImageIndex   = 1;
                frm.state               = "Update";
                frm.txtSuppId.Text      = dgSupp.CurrentRow.Cells[0].Value.ToString();
                frm.txtSuppName.Text    = dgSupp.CurrentRow.Cells[1].Value.ToString();
                frm.txtPhone.Text       = dgSupp.CurrentRow.Cells[2].Value.ToString();
                frm.txtEmail.Text       = dgSupp.CurrentRow.Cells[3].Value.ToString();
                frm.txtCompanyName.Text = dgSupp.CurrentRow.Cells[4].Value.ToString();
                frm.txtAddress.Text     = dgSupp.CurrentRow.Cells[5].Value.ToString();
                frm.dateSupp.Text       = dgSupp.CurrentRow.Cells[6].Value.ToString();
                frm.textUserName.Text   = dgSupp.CurrentRow.Cells[7].Value.ToString();
                frm.ShowDialog();

                DataView();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error" + ex.Message, "Super market", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                return;
            }
        }