protected void Page_Command(object sender, CommandEventArgs e) { if (e.CommandName == "Search") { grdMain.CurrentPageIndex = 0; grdMain.DataBind(); } else if (e.CommandName == "SortGrid") { grdMain.SetSortFields(e.CommandArgument as string[]); arrSelectFields.Add(grdMain.SortColumn); } else if (e.CommandName == "MassUpdate") { string[] arrID = Request.Form.GetValues("chkMain"); if (arrID != null) { Stack stk = Utils.FilterByACL_Stack(m_sMODULE, "edit", arrID, "PRODUCT_TEMPLATES"); if (stk.Count > 0) { while (stk.Count > 0) { string sIDs = Utils.BuildMassIDs(stk); } Response.Redirect("Index.aspx"); } } } else if (e.CommandName == "MassDelete") { string[] arrID = Request.Form.GetValues("chkMain"); if (arrID != null) { Stack stk = Utils.FilterByACL_Stack(m_sMODULE, "delete", arrID, "PRODUCT_TEMPLATES"); if (stk.Count > 0) { while (stk.Count > 0) { string sIDs = Utils.BuildMassIDs(stk); } Response.Redirect("Index.aspx"); } } } else if (e.CommandName == "Export") { int nACLACCESS = Security.GetUserAccess(m_sMODULE, "export"); if (nACLACCESS >= 0) { if (nACLACCESS == ACL_ACCESS.OWNER) { vwMain.RowFilter = "ASSIGNED_USER_ID = '" + Security.USER_ID + "'"; } string[] arrID = Request.Form.GetValues("chkMain"); CRMExport.Export(vwMain, m_sMODULE, ctlExportHeader.ExportFormat, ctlExportHeader.ExportRange, grdMain.CurrentPageIndex, grdMain.PageSize, arrID); } } }
protected void Page_Command(object sender, CommandEventArgs e) { if (e.CommandName == "ProductCategories.Create") { Response.Redirect("edit.aspx"); } else if (e.CommandName == "ProductCategories.Delete") { Guid gID = CommonTypeConvert.ToGuid(e.CommandArgument); CommonProcedure.spPRODUCT_CATEGORIES_Delete(gID); Cache.Remove("vwPRODUCT_CATEGORIES_LISTBOX"); Response.Redirect("Index.aspx"); } else if (e.CommandName == "Export") { int nACLACCESS = Security.GetUserAccess(m_sMODULE, "export"); if (nACLACCESS >= 0) { string[] arrID = Request.Form.GetValues("chkMain"); CRMExport.Export(vwMain, m_sMODULE, ctlExportHeader.ExportFormat, ctlExportHeader.ExportRange, grdMain.CurrentPageIndex, grdMain.PageSize, arrID); } } }
protected void Page_Command(object sender, CommandEventArgs e) { if (e.CommandName == "Search") { grdMain.CurrentPageIndex = 0; grdMain.DataBind(); } else if (e.CommandName == "SortGrid") { grdMain.SetSortFields(e.CommandArgument as string[]); arrSelectFields.Add(grdMain.SortColumn); } else if (e.CommandName == "MassUpdate") { string[] arrID = Request.Form.GetValues("chkMain"); if (arrID != null) { Stack stk = Utils.FilterByACL_Stack(m_sMODULE, "edit", arrID, "INVOICES"); if (stk.Count > 0) { while (stk.Count > 0) { string sIDs = Utils.BuildMassIDs(stk); CommonProcedure.InvoicesMassUpdate(sIDs, ctlMassUpdate.ASSIGNED_USER_ID, ctlMassUpdate.PAYMENT_TERMS, ctlMassUpdate.INVOICE_STAGE, TimeZone.GetTimeZone.ToServerTime(ctlMassUpdate.DUE_DATE), ctlMassUpdate.TEAM_ID); } Response.Redirect("Index.aspx"); } } } else if (e.CommandName == "MassDelete") { string[] arrID = Request.Form.GetValues("chkMain"); if (arrID != null) { Stack stk = Utils.FilterByACL_Stack(m_sMODULE, "delete", arrID, "INVOICES"); if (stk.Count > 0) { while (stk.Count > 0) { string sIDs = Utils.BuildMassIDs(stk); CommonProcedure.InvoicesMassDelete(sIDs); } Response.Redirect("Index.aspx"); } } } else if (e.CommandName == "Export") { // Apply ACL rules to Export. int nACLACCESS = Security.GetUserAccess(m_sMODULE, "export"); if (nACLACCESS >= 0) { if (nACLACCESS == ACL_ACCESS.OWNER) { vwMain.RowFilter = "ASSIGNED_USER_ID = '" + Security.USER_ID + "'"; } string[] arrID = Request.Form.GetValues("chkMain"); CRMExport.Export(vwMain, m_sMODULE, ctlExportHeader.ExportFormat, ctlExportHeader.ExportRange, grdMain.CurrentPageIndex, grdMain.PageSize, arrID); } } }