Ejemplo n.º 1
0
    protected void btnDelete_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            int subId = int.Parse((((ImageButton)sender).CommandArgument.ToString()));
            ulBus = new UserLoginBUS();
            ConnectionData.OpenMyConnection();

            // DataTable table = ulBus.GetUserIdBySubID(subId);
            //  int UserId = int.Parse(table.Rows[0]["UserId"].ToString());

            DataTable table = ulBus.GetBySubId(subId);
            string Username = table.Rows[0]["subEmail"].ToString();

            ulBus.tblUserLoginSub_Delete(Username);

            ulBus.tblSubClient_Delete(subId);

            //lay UserID

            ConnectionData.CloseMyConnection();
            pnError.Visible = false;
            pnSuccess.Visible = true;
            lblSuccess.Text = "Xóa thành công !";
        }
        catch (Exception ex)
        {
            pnError.Visible = true;
            lblError.Text = "Không thể xóa !</br>" + ex.Message;
            logs.Error(userLogin.Username + "subClient-Delete", ex);
        }
        LoadData();
    }