Ejemplo n.º 1
0
 public void grdListCategory_EditCommand(object source, DataGridCommandEventArgs e)
 {
     HPCBusinessLogic.DAL.T_CustomersDAL obj_Cate = new HPCBusinessLogic.DAL.T_CustomersDAL();
     if (e.CommandArgument.ToString().ToLower() == "edit")
     {
         int catID = Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString());
         Response.Redirect("~/Quangcao/CustomerEdit.aspx?Menu_ID=" + Page.Request["Menu_ID"].ToString() + "&ID=" + catID);
     }
     if (e.CommandArgument.ToString().ToLower() == "delete")
     {
         obj_Cate.DeleteFrom_T_Customers(Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString()));
         //#region SYNC
         //if (UltilFunc.Check_SyncNewsDatabase(Request["Menu_ID"]))
         //    SynData_DeleteT_T_CustumerAny(Convert.ToInt32(this.grdListCate.DataKeys[e.Item.ItemIndex].ToString()), Global.Path_Service);
         //#endregion
         string strLog = "[Xóa khách hàng]-->[Thao tác khách hàng][ID:" + this.grdListCate.DataKeys[e.Item.ItemIndex].ToString() + " ]";
         WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Xóa]", Request["Menu_ID"].ToString(), strLog, 0, ConstAction.TSAnh);
         this.LoadData();
     }
     else if (e.CommandArgument.ToString().ToLower() == "editorder")
     {
         string _catid = this.grdListCate.DataKeys[e.Item.ItemIndex].ToString();
         this.LoadData();
     }
 }
Ejemplo n.º 2
0
 protected void btnLinkDelete_Click(object sender, EventArgs e)
 {
     foreach (DataGridItem m_Item in grdListCate.Items)
     {
         CheckBox chk_Select = (CheckBox)m_Item.FindControl("optSelect");
         if (chk_Select != null && chk_Select.Checked)
         {
             LinkButton linkname = (LinkButton)m_Item.FindControl("btnEdit");
             int        News_ID  = int.Parse(grdListCate.DataKeys[int.Parse(m_Item.ItemIndex.ToString())].ToString());
             HPCBusinessLogic.DAL.T_CustomersDAL tt = new HPCBusinessLogic.DAL.T_CustomersDAL();
             tt.DeleteFrom_T_Customers(News_ID);
             //#region SYNC TEXT
             //if (UltilFunc.Check_SyncNewsDatabase(Request["Menu_ID"]))
             //    SynData_DeleteT_T_CustumerAny(News_ID, Global.Path_Service);
             //#endregion
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, linkname.Text,
                                                            Request["Menu_ID"].ToString(), "[Danh sách khách hàng]-->[Thao tác Xóa khách hàng]ID:" + News_ID.ToString() + " ]", 0, 0);
         }
     }
     LoadData();
 }