protected override void PageLoad() { //string allCompanyID = CompanyBLL.SystemCompanyId + "," + base.ParentCompanyID + "," + base.SonCompanyID; base.PageLoad(); base.Title = "KPI指标列表"; string action = RequestHelper.GetQueryString <string>("Action"); if (action == "Delete") { string selectID = RequestHelper.GetQueryString <string>("SelectID"); if (!string.IsNullOrEmpty(selectID)) { base.CheckUserPower("DeleteKPI", PowerCheckType.Single); KPIBLL.DeleteKPI(selectID); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("KPI"), selectID); ResponseHelper.Redirect(Request.UrlReferrer.ToString()); } } base.CheckUserPower("ReadKPI", PowerCheckType.Single); Company = CompanyBLL.ReadCompany(CompanyID); KPISearchInfo kpiSearch = new KPISearchInfo(); kpiSearch.ParentId = "0"; KPIClassList = KPIBLL.SearchKPIList(kpiSearch); if (ClassID > 0) { kpiSearch.ParentId = ClassID.ToString(); } else { kpiSearch.ParentId = string.Empty; } kpiSearch.Name = Name; if (CompanyID < 0) { kpiSearch.CompanyID = CompanyBLL.SystemCompanyId.ToString(); if (!string.IsNullOrEmpty(base.ParentCompanyID)) { kpiSearch.CompanyID += "," + base.ParentCompanyID; } if (!string.IsNullOrEmpty(base.SonCompanyID)) { kpiSearch.CompanyID += "," + base.SonCompanyID; } } else { kpiSearch.CompanyID = CompanyID.ToString(); } KPIList = KPIBLL.SearchKPIList(kpiSearch, base.CurrentPage, base.PageSize, ref this.Count); base.BindPageControl(ref base.CommonPager); }
protected void DeleteButton_Click(object sender, EventArgs e) { base.CheckAdminPower("DeleteKPI", PowerCheckType.Single); string intsForm = RequestHelper.GetIntsForm("SelectID"); if (intsForm != string.Empty) { KPIBLL.DeleteKPI(intsForm); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("KPI"), intsForm); ScriptHelper.Alert(ShopLanguage.ReadLanguage("DeleteOK"), RequestHelper.RawUrl); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { string Action = RequestHelper.GetQueryString <string>("Action"); if (Action == "Delete") { int id = RequestHelper.GetQueryString <int>("ID"); if (id != -2147483648) { base.CheckAdminPower("DeleteKPI", PowerCheckType.Single); KPIBLL.DeleteKPI(id.ToString()); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("DeleteRecord"), ShopLanguage.ReadLanguage("KPI"), id); } } if (companyId > 0) { CompanyInfo company = CompanyBLL.ReadCompany(companyId); _currentCompanyName = company.CompanySimpleName; CompanyName.Value = company.CompanyName; } base.CheckAdminPower("ReadKPI", PowerCheckType.Single); KPISearchInfo kpi = new KPISearchInfo(); kpi.ParentId = "0"; KPICate.DataSource = KPIBLL.SearchKPIList(kpi); KPICate.DataTextField = "Name"; KPICate.DataValueField = "ID"; KPICate.DataBind(); KPICate.Items.Insert(0, new ListItem("请选择分类", "")); if (parentId > 0) { kpi.ParentId = parentId.ToString(); KPICate.SelectedValue = parentId.ToString(); } else { kpi.ParentId = string.Empty; } kpi.Name = kpiName; if (companyId > 0) { kpi.CompanyID = companyId.ToString(); } base.BindControl(KPIBLL.SearchKPIList(kpi, base.CurrentPage, base.PageSize, ref this.Count), this.RecordList, this.MyPager); Name.Text = kpiName; } }
protected void KpisGridView_RowCommand(object sender, GridViewCommandEventArgs e) { int kpiId = 0; try { kpiId = Convert.ToInt32(e.CommandArgument); } catch (Exception ex) { log.Error(Resources.Kpi.MessageErrorKpiID, ex); } if (kpiId <= 0) { SystemMessages.DisplaySystemErrorMessage(Resources.Kpi.MessageNotAction); return; } if (e.CommandName == "ViewKpi") { Session["KpiId"] = kpiId.ToString(); Session["SEARCH_PARAMETER"] = KPISearchControl.Query; Response.Redirect("~/Kpis/KpiDetails.aspx"); } if (e.CommandName == "EditKpi") { Session["KPI_ID"] = kpiId.ToString(); Response.Redirect("~/Kpi/KpiForm.aspx"); } if (e.CommandName == "ShareKpi") { Session["KPIID"] = kpiId.ToString(); Response.Redirect("~/Kpi/ShareKpi.aspx"); } if (e.CommandName == "ListValuesKpi") { Session["KPIID"] = kpiId.ToString(); Response.Redirect("~/Kpi/ImportData.aspx"); } if (e.CommandName == "ViewOrganization") { Session["SEARCH_PARAMETER"] = "@organizationID " + kpiId.ToString(); Response.Redirect("~/Organization/ListOrganizations.aspx"); } if (e.CommandName == "ViewProject") { Session["SEARCH_PARAMETER"] = "@projectID " + kpiId.ToString(); Response.Redirect("~/Project/ProjectList.aspx"); } if (e.CommandName == "ViewArea") { Session["OrganizationId"] = kpiId.ToString(); Response.Redirect("~/Organization/EditOrganization.aspx"); } if (e.CommandName == "DeleteKpi") { try { KPIBLL.DeleteKPI(kpiId); } catch (Exception ex) { SystemMessages.DisplaySystemErrorMessage(ex.Message); return; } KpisGridView.DataBind(); } }