Esempio n. 1
0
    protected void btnDelete_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            ctBUS = new CustomerBUS();
            dtgBUS = new DetailGroupBUS();
            int CustomerID = int.Parse(((ImageButton)sender).CommandArgument.ToString());
            ConnectionData.OpenMyConnection();
            ctBUS.tblCustomer_Delete(CustomerID);
            dtgBUS.tblDetailGroup_DeleteByCustomerID(CustomerID);
            pnError.Visible = false;
            pnSuccess.Visible = true;
            lblSuccess.Text = "Xóa thành công một khách hàng ID: " + CustomerID.ToString();
            LoadCustomer();
            ConnectionData.CloseMyConnection();
        }
        catch (Exception ex)
        {

            logs.Error(userLogin.Username + "-Client - btnDelete_Click", ex);
            pnSuccess.Visible = false;
            pnError.Visible = true;
            lblError.Text = ex.Message;
        }
    }