protected void btnDeleteFilterReport_Click(object sender, EventArgs e) { if (MainContentPlaceHolder != null) { var FilterReportList = MainContentPlaceHolder.FindControl("FilterReportList") as DropDownList; var FilterReportName = MainContentPlaceHolder.FindControl("FilterReportName") as TextBox; if (FilterReportList != null && FilterReportName != null) { FilterReportApplicationLogic filterReportApplicationLogic = (FilterReportApplicationLogic)CreateApplicationLogicInstance(typeof(FilterReportApplicationLogic)); FilterReportApplicationData filterReportApplicationData = new FilterReportApplicationData(); if (FilterReportList.SelectedIndex <= 0 || !string.Equals(FilterReportName.Text.TrimIfNotNullOrWhiteSpace(), FilterReportList.SelectedItem.Text, StringComparison.OrdinalIgnoreCase)) { return; } filterReportApplicationData = FilterReportBusinessEntity.GetDataByObjectID(FilterReportList.SelectedValue); if (filterReportApplicationData.XTBG != "0") { MessageContent += @"<font color=""red"">没有权限删除系统报告。</font>"; } else if (!filterReportApplicationData.UserID.Equals((string)Session[ConstantsManager.SESSION_USER_ID])) { MessageContent += @"<font color=""red"">没有权限删除共享报告。</font>"; } else { filterReportApplicationLogic.Delete(new FilterReportApplicationData() { ObjectID = filterReportApplicationData.ObjectID, OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.ID }); FilterReportDataBind((string)Session[ConstantsManager.SESSION_USER_ID], FilterReportList); FilterReportList_SelectedIndexChanged(sender, e); } } } }
protected override void btnSaveFilterReport_Click(object sender, EventArgs e) { if (FilterReportName.Text.IsHtmlNullOrWiteSpace()) { return; } appData = new DictionaryApplicationData(); GetQueryInputParameter(); FilterReportApplicationLogic filterReportApplicationLogic = (FilterReportApplicationLogic)CreateApplicationLogicInstance(typeof(FilterReportApplicationLogic)); FilterReportApplicationData filterReportApplicationData = new FilterReportApplicationData() { BGMC = FilterReportName.Text.TrimIfNotNullOrWhiteSpace(), UserID = (string)Session[ConstantsManager.SESSION_USER_ID], BGLX = FilterReportType, GXBG = "0", XTBG = "0", BGCXTJ = JsonHelper.ObjectToJson(appData), BGCJSJ = DateTime.Now, }; FilterReportApplicationData filterReportQueryApplicationData; if (!FilterReportName.Text.IsHtmlNullOrWiteSpace()) { filterReportQueryApplicationData = new FilterReportApplicationData() { BGMC = FilterReportName.Text.TrimIfNotNullOrWhiteSpace(), UserID = (string)Session[ConstantsManager.SESSION_USER_ID], BGLX = FilterReportType, XTBG = "0", CurrentPage = 1, PageSize = 1000, }; filterReportQueryApplicationData = filterReportApplicationLogic.Query(filterReportQueryApplicationData); if (filterReportQueryApplicationData.ResultSet.Tables.Count > 0) { foreach (DataRow item in filterReportQueryApplicationData.ResultSet.Tables[0].Rows) { filterReportApplicationLogic.Delete(new FilterReportApplicationData() { ObjectID = GetValue(item["ObjectID"]), OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.ID }); } } } filterReportApplicationLogic.Add(filterReportApplicationData); FilterReportDataBind((string)Session[ConstantsManager.SESSION_USER_ID], FilterReportList); FilterReportList.Items.FindByText(FilterReportName.Text.TrimIfNotNullOrWhiteSpace()).Selected = true; }
protected void btnInfoFromDocBatch_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); dt = GetTemplateColumn(dt); dt = FileLibrary.GetDataFromWordBatch(ConstantsManager.WEBSITE_VIRTUAL_ROOT_DIR + "/" + ConstantsManager.UPLOAD_DOC_DIR + "/" + "FilterReport", dt, true, true); FilterReportApplicationLogic instanceFilterReportApplicationLogic = (FilterReportApplicationLogic)CreateApplicationLogicInstance(typeof(FilterReportApplicationLogic)); foreach (DataRow dr in dt.Rows) { appData = new FilterReportApplicationData(); int i = 0; appData = instanceFilterReportApplicationLogic.Add(appData); } }
protected void FilterReportDataBind(string userID, DropDownList filterReportList, string defaultSelectValue = null) { FilterReportApplicationLogic filterReportApplicationLogic = (FilterReportApplicationLogic)CreateApplicationLogicInstance(typeof(FilterReportApplicationLogic)); FilterReportApplicationData filterReportApplicationData = new FilterReportApplicationData() { UserID = userID, BGLX = FilterReportType, GXBG = "0", XTBG = "0", CurrentPage = 1, PageSize = 1000, }; filterReportApplicationData = filterReportApplicationLogic.Query(filterReportApplicationData); filterReportList.DataSource = filterReportApplicationData.ResultSet; filterReportList.DataBind(); filterReportList.Items.Insert(0, new ListItem("选择报告", "")); if (!defaultSelectValue.IsNullOrWhiteSpace()) { filterReportList.SelectedValue = defaultSelectValue; } }
protected void btnInfoFromDS_Click(object sender, EventArgs e) { int totalCount = 0; int importCount = 0; int updateCount = 0; try { var appDatas = FilterReportApplicationData.GetDataFromDataFile <FilterReportApplicationData>(InfoFromDoc.Text, true, true, recordStartLine: FilterReportContants.ImportDataSetStartLineNum); FilterReportApplicationLogic instanceFilterReportApplicationLogic = (FilterReportApplicationLogic)CreateApplicationLogicInstance(typeof(FilterReportApplicationLogic)); totalCount = appDatas.Count; foreach (var app in appDatas) { if (!BGMC.Text.IsHtmlNullOrWiteSpace()) { app.BGMC = Convert.ToString(BGMC.Text); } app.UserID = (string)Session[ConstantsManager.SESSION_USER_ID]; string strUserID = GetValue(new RICH.Common.BM.T_PM_UserInfo.T_PM_UserInfoApplicationLogicBase().GetValueByFixCondition("UserLoginName", app.UserID, "UserID")); if (!DataValidateManager.ValidateIsNull(strUserID)) { app.UserID = strUserID; } if (!BGLX.Text.IsHtmlNullOrWiteSpace()) { app.BGLX = Convert.ToString(BGLX.Text); } string strGXBG = GetValue(new RICH.Common.BM.Dictionary.DictionaryApplicationLogicBase().GetValueByFixCondition("MC", app.GXBG, "DM")); if (!DataValidateManager.ValidateIsNull(strGXBG)) { app.GXBG = strGXBG; } if (!GXBG.SelectedValue.IsHtmlNullOrWiteSpace()) { app.GXBG = Convert.ToString(GXBG.SelectedValue); } string strXTBG = GetValue(new RICH.Common.BM.Dictionary.DictionaryApplicationLogicBase().GetValueByFixCondition("MC", app.XTBG, "DM")); if (!DataValidateManager.ValidateIsNull(strXTBG)) { app.XTBG = strXTBG; } if (!XTBG.SelectedValue.IsHtmlNullOrWiteSpace()) { app.XTBG = Convert.ToString(XTBG.SelectedValue); } if (!BGCXTJ.Text.IsHtmlNullOrWiteSpace()) { app.BGCXTJ = Convert.ToString(BGCXTJ.Text); } app.BGCJSJ = DateTime.Now; instanceFilterReportApplicationLogic.Add(app); if (app.ResultCode == RICH.Common.Base.ApplicationData.ApplicationDataBase.ResultState.Succeed) { importCount++; } else { app.OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.PK; instanceFilterReportApplicationLogic.Modify(app); if (app.ResultCode == RICH.Common.Base.ApplicationData.ApplicationDataBase.ResultState.Succeed) { updateCount++; } } } MessageContent += @"<font color=""green"">共{0}条数据,导入数据{1}条,更新数据{2}条。</font>".FormatInvariantCulture(totalCount, importCount, updateCount); } catch (Exception ex) { MessageContent += @"<font color=""red"">导入数据过程出错:{0}<br/>共{1}条数据,已导入数据{2}条,已更新数据{3}条。</font>".FormatInvariantCulture(ex.Message, totalCount, importCount, updateCount); } }