Example #1
0
        private void btnDeleteCustomer_Click(object sender, EventArgs e)
        {
            //DataTable ExistEmployee = get_service.GetEmployeeInInvoiceTotal(txtEmpID.Text);
            //if (ExistEmployee.Rows.Count > 0)
            //{
            //    DialogResult t =
            //        MessBox2Choice.ShowBox("Nhân viên mà bạn xóa \nHiện không xóa được.\n Bạn có muốn xóa không", Color.YellowGreen);
            //    if (t.Equals(System.Windows.Forms.DialogResult.No))
            //        return;

            //}
            if (txtMaKH.Text == "101")
            {
                Alert.Show("Không thể xóa \nkhách hàng này !", Color.Red);
                return;
            }
            foreach (Persistence.CustomerSwipe o in swipeList)
            {
                get_service.DeleteCustSwipe(txtMaKH.Text, o.swipeId);
            }
            get_service.DeleteCustomer(txtMaKH.Text);
            Customers = get_service.GetAllCustomers();
            limit     = Customers.Rows.Count - 1;
            btnPrevious_Click(btnPrevious, null);
        }