Exemplo n.º 1
0
        private void btn_Save_Customer_Click(object sender, EventArgs e)
        {
            BLCustomer blC = new BLCustomer();

            if (SaveStatus == 1)
            {
                blC.CreateCustomer(txt_Customer_CustomerName.Text,
                                   txt_Customer_IdentityCard.Text,
                                   txt_Customer_PhoneNumber.Text,
                                   txt_Customer_CustomerAddress.Text);
            }
            else if (SaveStatus == 2)
            {
                blC.UpdateCustomer(txt_Customer_CustomerID.Text,
                                   txt_Customer_CustomerName.Text,
                                   txt_Customer_IdentityCard.Text,
                                   txt_Customer_PhoneNumber.Text,
                                   txt_Customer_CustomerAddress.Text);
            }
            SaveStatus = 0;
            dgv_Customer.DataSource = blC.LoadCustomer();
            dgv_Customer_CellClick(null, null);
            btn_Update_Customer.Enabled = true;
            btn_Create_Customer.Enabled = true;
            btn_Save_Customer.Enabled   = false;
        }
Exemplo n.º 2
0
        private void btn_Delete_Customer_Click(object sender, EventArgs e)
        {
            BLCustomer blC = new BLCustomer();

            blC.DeleteCustomer(txt_Customer_CustomerID.Text);
            dgv_Customer.DataSource = blC.LoadCustomer();
            dgv_Customer_CellClick(null, null);
        }
Exemplo n.º 3
0
        private void btn_Customer_Click(object sender, EventArgs e)
        {
            TabControl_Main.TabPages.Clear();
            TabControl_Main.TabPages.Add(TabPage_Customer);
            dgv_Customer.AutoResizeColumns();
            BLCustomer dbC  = new BLCustomer();
            var        data = dbC.LoadCustomer();

            if (data != null)
            {
                dgv_Customer.DataSource = data;
            }
            else
            {
                dgv_Customer.DataSource = null;
            }
            dgv_Customer_CellClick(null, null);
            txt_Customer_CustomerID.Enabled = false;
        }