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); } }
//===================================================================== // FunctionName : GetTableCaption /// <summary> /// 得到信息标题 /// </summary> //===================================================================== private string GetTableCaption() { System.Text.StringBuilder sbCaption = new System.Text.StringBuilder(string.Empty); sbCaption.Append(@"<div class=""caption"">"); sbCaption.Append(@"课程预约信息列表"); sbCaption.Append(@"</div>"); sbCaption.Append(@"<div class=""captionnote"">"); sbCaption.Append(@"查询条件如下:"); if (!DataValidateManager.ValidateIsNull(KCBBH.SelectedValue)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("课程表编号:"); sbCaption.Append(new RICH.Common.BM.T_BM_KCBXX.T_BM_KCBXXBusinessEntity().GetValueByFixCondition("KCBBH", KCBBH.SelectedValue, "KCBH")); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(HYBH.SelectedValue)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("会员编号:"); sbCaption.Append(new RICH.Common.BM.T_BM_HYXX.T_BM_HYXXBusinessEntity().GetValueByFixCondition("HYBH", HYBH.SelectedValue, "HYXM")); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(YYSJ.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("预约时间:"); sbCaption.Append(YYSJ.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(YYSJBegin.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("预约时间开始值:"); sbCaption.Append(YYSJBegin.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(YYSJEnd.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("预约时间结束值:"); sbCaption.Append(YYSJEnd.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(YYBZ.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("预约备注:"); sbCaption.Append(YYBZ.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(SKZT.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("上课状态:"); sbCaption.Append(SKZT.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(PJR.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("评价人:"); sbCaption.Append(new RICH.Common.BM.T_PM_UserInfo.T_PM_UserInfoBusinessEntity().GetValueByFixCondition("UserID", PJR.Text, "UserNickName")); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(PJSJ.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("评价时间:"); sbCaption.Append(PJSJ.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(PJSJBegin.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("评价时间开始值:"); sbCaption.Append(PJSJBegin.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(PJSJEnd.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("评价时间结束值:"); sbCaption.Append(PJSJEnd.Text); sbCaption.Append(@"</div>"); } // 一对一相关表 sbCaption.Append("</div>"); return(sbCaption.ToString()); }
//===================================================================== // FunctionName : GetCountInputParameter /// <summary> /// 得到统计记录数用户输入参数操作(通过Request对象) /// </summary> //===================================================================== protected override Boolean GetCountInputParameter() { Boolean boolReturn = true; ValidateData validateData = new ValidateData(); // 验证输入参数 if (!DataValidateManager.ValidateIsNull(CountField.SelectedValue)) { if (!DataValidateManager.ValidateStringLengthRange(CountField.SelectedValue.ToString(), 1, 50)) { strMessageParam[0] = "统计方式"; strMessageParam[1] = "1"; strMessageParam[2] = "50"; strMessageInfo = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0004, strMessageParam, strMessageInfo); boolReturn = false; } else { appData.CountField = CountField.SelectedValue.ToString(); } } else { strMessageParam[0] = "统计方式"; strMessageInfo = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0002, strMessageParam, strMessageInfo); boolReturn = false; } if (!DataValidateManager.ValidateIsNull(ViewState["Sort"])) { if (!DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString())) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (!DataValidateManager.ValidateIsNull(ViewState["SortField"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString())) { appData.SortField = "RecordID"; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = "RecordID"; } return(boolReturn); }
protected virtual ValidateData ValidateObjectID(object objValidateData, bool boolNullable, bool boolExist) { ValidateData validateData = new ValidateData(); try { // 初始化参数 validateData.Result = true; validateData.Message = string.Empty; validateData.Parameters = new string[5]; validateData.IsNull = false; validateData.IsExist = false; // 传入参数赋值 validateData.Value = objValidateData; validateData.Nullable = boolNullable; validateData.Exist = boolExist; validateData.Parameters[0] = ""; validateData.Parameters[1] = "null"; validateData.Parameters[2] = "null"; // 空验证 if (DataValidateManager.ValidateIsNull(validateData.Value) == false) { // 数值格式验证 if (DataValidateManager.ValidateUniqueIdentifierFormat(validateData.Value, null, null) == false) { validateData.Message = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0012, validateData.Parameters); validateData.Result = false; } else { // 数据存在验证 if (validateData.Exist == true) { if (AJAX_IsExist("ObjectID", validateData.Value.ToString()) == true) { validateData.IsExist = true; validateData.Message = @"已存在,请再换一个。"; validateData.Result = false; } else { validateData.Message = @"不存在,可以使用。"; validateData.Result = true; } } else { validateData.Result = true; } } } else { validateData.IsNull = true; if (validateData.Nullable == false) { validateData.Message = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0002, validateData.Parameters); validateData.Result = false; } } } catch (Exception) { validateData.Result = false; } return(validateData); }
protected override Boolean GetQueryInputParameter() { Boolean boolReturn = true; ValidateData validateData = new ValidateData(); // 验证输入参数 validateData = ValidateKCXLBHBatch(Request["KCXLBH"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.KCXLBHBatch = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateKCXLBH(Request["KCXLBH"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.KCXLBH = null; appData.KCXLBHBatch = GetSubItem_KCXLBH(validateData.Value.ToString()) + "," + validateData.Value.ToString(); } } validateData = ValidateKCBH(Request["KCBH"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.KCBH = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateKCSJBegin(Request["KCSJBegin"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.KCSJBegin = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateKCSJEnd(Request["KCSJEnd"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.KCSJEnd = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateKCSJ(Request["KCSJ"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.KCSJ = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateSKJS(Request["SKJS"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.SKJS = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateSKFJ(Request["SKFJ"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.SKFJ = Convert.ToString(validateData.Value.ToString()); } } if (!string.IsNullOrWhiteSpace(Request["SearchKeywords"])) { appData.KCBH = Convert.ToString(Request["SearchKeywords"]); } if (!DataValidateManager.ValidateIsNull(ViewState["QueryType"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["QueryType"].ToString())) { appData.QueryType = "AND"; } else { appData.QueryType = ViewState["QueryType"].ToString(); } } else { appData.SortField = "AND"; } if (!DataValidateManager.ValidateIsNull(ViewState["Sort"])) { if (!DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString())) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (!DataValidateManager.ValidateIsNull(ViewState["SortField"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString())) { appData.SortField = DEFAULT_SORT_FIELD; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = DEFAULT_SORT_FIELD; } if (!DataValidateManager.ValidateIsNull(ViewState["PageSize"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["PageSize"].ToString())) { appData.PageSize = DEFAULT_PAGE_SIZE; } else { appData.PageSize = Convert.ToInt32(ViewState["PageSize"].ToString()); } } else { appData.PageSize = DEFAULT_PAGE_SIZE; } if (!DataValidateManager.ValidateIsNull(ViewState["CurrentPage"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["CurrentPage"].ToString())) { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } else { appData.CurrentPage = Convert.ToInt32(ViewState["CurrentPage"].ToString()); } } else { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } if (CustomPermission == WDKCB_PURVIEW_ID) { appData.SKJS = CurrentUserInfo.UserID; } return(boolReturn); }
//===================================================================== // FunctionName : GetQueryInputParameter /// <summary> /// 得到查询用户输入参数操作(通过Request对象) /// </summary> //===================================================================== protected override Boolean GetQueryInputParameter() { Boolean boolReturn = true; ValidateData validateData = new ValidateData(); // 验证输入参数 validateData = ValidateLMM(LMM.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.LMM = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateSJLMH(SJLMH.SelectedValue, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.SJLMH = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateLMNR(LMNR.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.LMNR = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateLMLBYS(LMLBYS.SelectedValue, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.LMLBYS = Convert.ToString(validateData.Value.ToString()); } } if (!DataValidateManager.ValidateIsNull(ViewState["QueryType"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["QueryType"].ToString())) { appData.QueryType = "AND"; } else { appData.QueryType = ViewState["QueryType"].ToString(); } } else { appData.SortField = "AND"; } if (!DataValidateManager.ValidateIsNull(ViewState["Sort"])) { if (!DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString())) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (!DataValidateManager.ValidateIsNull(ViewState["SortField"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString())) { appData.SortField = DEFAULT_SORT_FIELD; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = DEFAULT_SORT_FIELD; } if (!DataValidateManager.ValidateIsNull(ViewState["PageSize"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["PageSize"].ToString())) { appData.PageSize = DEFAULT_PAGE_SIZE; } else { appData.PageSize = Convert.ToInt32(ViewState["PageSize"].ToString()); } } else { appData.PageSize = DEFAULT_PAGE_SIZE; } if (!DataValidateManager.ValidateIsNull(ViewState["CurrentPage"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["CurrentPage"].ToString())) { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } else { appData.CurrentPage = Convert.ToInt32(ViewState["CurrentPage"].ToString()); } } else { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } return(boolReturn); }
//===================================================================== // FunctionName : GetTableCaption /// <summary> /// 得到信息标题 /// </summary> //===================================================================== private string GetTableCaption() { System.Text.StringBuilder sbCaption = new System.Text.StringBuilder(string.Empty); sbCaption.Append(@"<div class=""caption"">"); sbCaption.Append(@"消息列表"); sbCaption.Append(@"</div>"); sbCaption.Append(@"<div class=""captionnote"">"); sbCaption.Append(@"查询条件如下:"); if (!DataValidateManager.ValidateIsNull(DXXBT.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("标题:"); sbCaption.Append(DXXBT.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(DXXNR.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("内容:"); sbCaption.Append(DXXNR.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(FSSJ.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("发送时间:"); sbCaption.Append(FSSJ.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(FSSJBegin.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("发送时间开始值:"); sbCaption.Append(FSSJBegin.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(FSSJEnd.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("发送时间结束值:"); sbCaption.Append(FSSJEnd.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(FSR.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("发送人:"); sbCaption.Append(new RICH.Common.BM.T_PM_UserInfo.T_PM_UserInfoBusinessEntity().GetValueByFixCondition("UserID", FSR.Text, "UserNickName")); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(FSBM.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("发送部门:"); sbCaption.Append(new RICH.Common.BM.T_BM_DWXX.T_BM_DWXXBusinessEntity().GetValueByFixCondition("DWBH", FSBM.Text, "DWMC")); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(JSR.SelectedValues)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("接收人:"); sbCaption.Append(new RICH.Common.BM.T_PM_UserInfo.T_PM_UserInfoBusinessEntity().GetValueByFixCondition("UserID", JSR.SelectedValues, "UserNickName")); sbCaption.Append(@"</div>"); } // 一对一相关表 sbCaption.Append("</div>"); return(sbCaption.ToString()); }
//===================================================================== // FunctionName : GetQueryInputParameter /// <summary> /// 得到查询用户输入参数操作(通过Request对象) /// </summary> //===================================================================== protected override Boolean GetQueryInputParameter() { Boolean boolReturn = true; ValidateData validateData = new ValidateData(); // 验证输入参数 validateData = ValidateBGMC(BGMC.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.BGMC = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateUserID(UserID.SelectedValue, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.UserID = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateBGLX(BGLX.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.BGLX = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateGXBG(GXBG.SelectedValue, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.GXBG = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateXTBG(XTBG.SelectedValue, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.XTBG = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateBGCJSJ(BGCJSJ.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.BGCJSJ = Convert.ToDateTime(validateData.Value.ToString()); } } if (!DataValidateManager.ValidateIsNull(ViewState["QueryType"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["QueryType"].ToString())) { appData.QueryType = "AND"; } else { appData.QueryType = ViewState["QueryType"].ToString(); } } else { appData.SortField = "AND"; } if (!DataValidateManager.ValidateIsNull(ViewState["Sort"])) { if (!DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString())) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (!DataValidateManager.ValidateIsNull(ViewState["SortField"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString())) { appData.SortField = DEFAULT_SORT_FIELD; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = DEFAULT_SORT_FIELD; } if (!DataValidateManager.ValidateIsNull(ViewState["PageSize"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["PageSize"].ToString())) { appData.PageSize = DEFAULT_PAGE_SIZE; } else { appData.PageSize = Convert.ToInt32(ViewState["PageSize"].ToString()); } } else { appData.PageSize = DEFAULT_PAGE_SIZE; } if (!DataValidateManager.ValidateIsNull(ViewState["CurrentPage"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["CurrentPage"].ToString())) { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } else { appData.CurrentPage = Convert.ToInt32(ViewState["CurrentPage"].ToString()); } } else { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } return(boolReturn); }
private void InitialPage() { //定义权限类型名临时变量 string strPurviewTypeName; int intCount; int i; htInputParameter = new Hashtable(); dsRecordInfo = new DataSet(); htInputParameter.Add(ConstantsManager.QUERY_DATASET_NAME, dsRecordInfo); htInputParameter.Add(ConstantsManager.MESSAGE_ID, ""); htInputParameter.Add("UserGroupID", lblUserGroupID.Text); UserGroupLibrary instanceUserGroupLibrary = new UserGroupLibrary(); htOutputParameter = instanceUserGroupLibrary.SelectRecordInfo(htInputParameter); dsRecordInfo = (DataSet)htOutputParameter[ConstantsManager.QUERY_DATASET_NAME]; lblUserGroupName.Text = dsRecordInfo.Tables[0].Rows[0]["UserGroupName"].ToString(); lblUserGroupID.Text = dsRecordInfo.Tables[0].Rows[0]["UserGroupID"].ToString(); lblUserGroupContent.Text = dsRecordInfo.Tables[0].Rows[0]["UserGroupContent"].ToString(); htInputParameter = new Hashtable(); dsRecordInfo = new DataSet(); htInputParameter.Add(ConstantsManager.QUERY_DATASET_NAME, dsRecordInfo); htInputParameter.Add(ConstantsManager.MESSAGE_ID, ""); htInputParameter.Add("UserGroupID", lblUserGroupID.Text); htInputParameter.Add("PurviewPRI", int.Parse(rblPurviewPRI.SelectedValue)); UserGroupPurviewLibrary instanceUserGroupPurviewLibrary = new UserGroupPurviewLibrary(); htOutputParameter = instanceUserGroupPurviewLibrary.GetUserGroupPurviewInfo(htInputParameter); dsRecordInfo = (DataSet)htOutputParameter[ConstantsManager.QUERY_DATASET_NAME]; strPurviewTypeName = ""; for (i = 0; i < dsRecordInfo.Tables[0].Rows.Count; i++) { TableRow trTemp = new TableRow(); intCount = i; for (int j = i; j < intCount + 4 && j < dsRecordInfo.Tables[0].Rows.Count; j++) { i = j; if (dsRecordInfo.Tables[0].Rows[i]["PurviewTypeName"].ToString() != strPurviewTypeName) { TableRow trTempTitle = new TableRow(); TableCell tcTempTitle = new TableCell(); Label lblTemp = new Label(); lblTemp.Text = dsRecordInfo.Tables[0].Rows[i]["PurviewTypeName"].ToString(); tcTempTitle.Controls.Add(lblTemp); tcTempTitle.ColumnSpan = 4; tcTempTitle.CssClass = "xingmu"; trTempTitle.Cells.Add(tcTempTitle); tbPurviewInfo.Rows.Add(trTemp); tbPurviewInfo.Rows.Add(trTempTitle); strPurviewTypeName = dsRecordInfo.Tables[0].Rows[i]["PurviewTypeName"].ToString(); trTemp = new TableRow(); } TableCell tcTemp = new TableCell(); CheckBox chkTemp = new CheckBox(); chkTemp.ID = dsRecordInfo.Tables[0].Rows[i]["PurviewID"].ToString(); chkTemp.Text = dsRecordInfo.Tables[0].Rows[i]["PurviewName"].ToString(); if (DataValidateManager.ValidateIsNull(dsRecordInfo.Tables[0].Rows[i]["IsPageMenu"]) == false) { if ((bool)dsRecordInfo.Tables[0].Rows[i]["IsPageMenu"] == true) { chkTemp.Text = chkTemp.Text + "(菜单项)"; } } chkTemp.InputAttributes.Add("value", dsRecordInfo.Tables[0].Rows[i]["PurviewID"].ToString()); if (dsRecordInfo.Tables[0].Rows[i]["UserGroupID"] == DBNull.Value || dsRecordInfo.Tables[0].Rows[i]["UserGroupID"].ToString() == "" || dsRecordInfo.Tables[0].Rows[i]["UserGroupID"].ToString() == string.Empty) { chkTemp.Checked = false; } else if (dsRecordInfo.Tables[0].Rows[i]["UserGroupID"] != DBNull.Value && dsRecordInfo.Tables[0].Rows[i]["UserGroupID"].ToString() != "" && dsRecordInfo.Tables[0].Rows[i]["UserGroupID"].ToString() != string.Empty) { chkTemp.Checked = true; } tcTemp.Controls.Add(chkTemp); tcTemp.CssClass = "hback"; trTemp.Cells.Add(tcTemp); } tbPurviewInfo.Rows.Add(trTemp); } }
protected void btnInfoFromDS_Click(object sender, EventArgs e) { int totalCount = 0; int importCount = 0; int updateCount = 0; try { var appDatas = ShortMessageApplicationData.GetDataFromDataFile <ShortMessageApplicationData>(InfoFromDoc.Text, true, true, recordStartLine: ShortMessageContants.ImportDataSetStartLineNum); ShortMessageApplicationLogic instanceShortMessageApplicationLogic = (ShortMessageApplicationLogic)CreateApplicationLogicInstance(typeof(ShortMessageApplicationLogic)); totalCount = appDatas.Count; foreach (var app in appDatas) { if (!DXXBT.Text.IsHtmlNullOrWiteSpace()) { app.DXXBT = Convert.ToString(DXXBT.Text); } app.DXXLX = "01"; if (!DXXNR.Text.IsHtmlNullOrWiteSpace()) { app.DXXNR = Convert.ToString(DXXNR.Text); } if (!DXXFJ.Text.IsHtmlNullOrWiteSpace()) { app.DXXFJ = Convert.ToString(DXXFJ.Text); } app.FSSJ = DateTime.Now; app.FSR = (string)Session[ConstantsManager.SESSION_USER_ID]; string strFSR = GetValue(new RICH.Common.BM.T_PM_UserInfo.T_PM_UserInfoApplicationLogicBase().GetValueByFixCondition("UserNickName", app.FSR, "UserID")); if (!DataValidateManager.ValidateIsNull(strFSR)) { app.FSR = strFSR; } app.FSBM = (string)Session[ConstantsManager.SESSION_SSDW_ID]; string strFSBM = GetValue(new RICH.Common.BM.T_BM_DWXX.T_BM_DWXXApplicationLogicBase().GetValueByFixCondition("DWMC", app.FSBM, "DWBH")); if (!DataValidateManager.ValidateIsNull(strFSBM)) { app.FSBM = strFSBM; } app.FSIP = (string)Request.ServerVariables["REMOTE_ADDR"]; string strJSR = GetValue(new RICH.Common.BM.T_PM_UserInfo.T_PM_UserInfoApplicationLogicBase().GetValueByFixCondition("UserNickName", app.JSR, "UserID")); if (!DataValidateManager.ValidateIsNull(strJSR)) { app.JSR = strJSR; } if (!JSR.SelectedValues.IsHtmlNullOrWiteSpace()) { app.JSR = Convert.ToString(JSR.SelectedValues); } instanceShortMessageApplicationLogic.Add(app); if (app.ResultCode == RICH.Common.Base.ApplicationData.ApplicationDataBase.ResultState.Succeed) { importCount++; } else { app.OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.PK; instanceShortMessageApplicationLogic.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); } }
protected void btnInfoFromDS_Click(object sender, EventArgs e) { int totalCount = 0; int importCount = 0; int updateCount = 0; try { var appDatas = T_BG_0602ApplicationData.GetDataFromDataFile <T_BG_0602ApplicationData>(InfoFromDoc.Text, true, true, recordStartLine: T_BG_0602Contants.ImportDataSetStartLineNum); T_BG_0602ApplicationLogic instanceT_BG_0602ApplicationLogic = (T_BG_0602ApplicationLogic)CreateApplicationLogicInstance(typeof(T_BG_0602ApplicationLogic)); totalCount = appDatas.Count; foreach (var app in appDatas) { app.LMH = instanceT_BG_0602ApplicationLogic.AutoGenerateLMH(app); if (!LMM.Text.IsHtmlNullOrWiteSpace()) { app.LMM = Convert.ToString(LMM.Text); } string strSJLMH = GetValue(new RICH.Common.BM.T_BG_0602.T_BG_0602ApplicationLogicBase().GetValueByFixCondition("LMM", app.SJLMH, "LMH")); if (!DataValidateManager.ValidateIsNull(strSJLMH)) { app.SJLMH = strSJLMH; } if (!SJLMH.SelectedValue.IsHtmlNullOrWiteSpace()) { app.SJLMH = Convert.ToString(SJLMH.SelectedValue); } if (!LMTP.Text.IsHtmlNullOrWiteSpace()) { app.LMTP = Convert.ToString(LMTP.Text); } if (!LMNR.Text.IsHtmlNullOrWiteSpace()) { app.LMNR = Convert.ToString(LMNR.Text); } string strLMLBYS = GetValue(new RICH.Common.BM.Dictionary.DictionaryApplicationLogicBase().GetValueByFixCondition("MC", app.LMLBYS, "DM")); if (!DataValidateManager.ValidateIsNull(strLMLBYS)) { app.LMLBYS = strLMLBYS; } if (!LMLBYS.SelectedValue.IsHtmlNullOrWiteSpace()) { app.LMLBYS = Convert.ToString(LMLBYS.SelectedValue); } string strSFLBLM = GetValue(new RICH.Common.BM.Dictionary.DictionaryApplicationLogicBase().GetValueByFixCondition("MC", app.SFLBLM, "DM")); if (!DataValidateManager.ValidateIsNull(strSFLBLM)) { app.SFLBLM = strSFLBLM; } if (!SFLBLM.SelectedValue.IsHtmlNullOrWiteSpace()) { app.SFLBLM = Convert.ToString(SFLBLM.SelectedValue); } string strSFWBURL = GetValue(new RICH.Common.BM.Dictionary.DictionaryApplicationLogicBase().GetValueByFixCondition("MC", app.SFWBURL, "DM")); if (!DataValidateManager.ValidateIsNull(strSFWBURL)) { app.SFWBURL = strSFWBURL; } if (!SFWBURL.SelectedValue.IsHtmlNullOrWiteSpace()) { app.SFWBURL = Convert.ToString(SFWBURL.SelectedValue); } if (!WBURL.Text.IsHtmlNullOrWiteSpace()) { app.WBURL = Convert.ToString(WBURL.Text); } instanceT_BG_0602ApplicationLogic.Add(app); if (app.ResultCode == RICH.Common.Base.ApplicationData.ApplicationDataBase.ResultState.Succeed) { importCount++; } else { app.OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.PK; instanceT_BG_0602ApplicationLogic.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); } }
protected Table GenerateHtmlTable( string strHeadText, string strContent, bool border = true, bool innerTable = false, string strTableCss = null, string strHeadCss = null, string strCellCss = null, string strTableWidth = null, string strCellWidth = null ) { Table htTemp = new Table(); strContent = strContent.Replace("\r", string.Empty).Replace("\n", string.Empty).Replace(" ", string.Empty); if (!DataValidateManager.ValidateIsNull(strTableCss)) { htTemp.CssClass = strTableCss; } htTemp.CellPadding = 0; htTemp.CellSpacing = 0; htTemp.BorderWidth = 0; htTemp.Style.Add("width", "100%"); string[] headText = strHeadText.Split(new string[] { ConstantsManager.FieldSplitString }, StringSplitOptions.None); TableRow htrHead = new TableRow(); for (int i = 0; i < headText.Length; i++) { TableCell htc = new TableCell(); htc.Text = headText[i]; if (!DataValidateManager.ValidateIsNull(strHeadCss)) { htc.CssClass = strHeadCss; } htc.Style.Add("text-align", "center"); htrHead.Cells.Add(htc); } htTemp.Rows.Add(htrHead); string[] rows = strContent.Split(new string[] { ConstantsManager.ItemSplitString }, StringSplitOptions.RemoveEmptyEntries); for (int index = 0; index < rows.Length; index++) { TableRow htr = new TableRow(); string[] fields = rows[index].Split(new string[] { ConstantsManager.FieldSplitString }, StringSplitOptions.None); for (int i = 0; i < fields.Length && i < headText.Length; i++) { TableCell htc = new TableCell(); htc.Text = fields[i]; if (!DataValidateManager.ValidateIsNull(strCellCss)) { htc.CssClass = strCellCss; } htc.Style.Add("text-align", "center !important"); htr.Cells.Add(htc); } htTemp.Rows.Add(htr); } // ÉèÖÃinner table±ß¿ò if (htTemp.Rows.Count > 0) { for (int index = 0; index < htTemp.Rows.Count; index++) { for (int i = 0; i < htTemp.Rows[index].Cells.Count; i++) { if (border && innerTable) { htTemp.Rows[index].Cells[i].Style.Add("border-top", index == 0 ? "0px black solid" : "1px black solid"); htTemp.Rows[index].Cells[i].Style.Add("border-left", i == 0 ? "0px black solid" : "1px black solid"); htTemp.Rows[index].Cells[i].Style.Add("border-bottom", index == htTemp.Rows.Count - 1 ? "0px black solid" : "1px black solid"); htTemp.Rows[index].Cells[i].Style.Add("border-right", i == headText.Length - 1 ? "0px black solid" : "1px black solid"); } else if (border) { htTemp.Rows[index].Cells[i].Style.Add("border", "1px black solid"); } else { htTemp.Rows[index].Cells[i].Style.Add("border", "0px black solid"); } } } } return(htTemp); }
//===================================================================== // FunctionName : GetTableCaption /// <summary> /// 得到信息标题 /// </summary> //===================================================================== private string GetTableCaption() { System.Text.StringBuilder sbCaption = new System.Text.StringBuilder(string.Empty); sbCaption.Append(@"<div class=""caption"">"); sbCaption.Append(@"会员信息列表"); sbCaption.Append(@"</div>"); sbCaption.Append(@"<div class=""captionnote"">"); sbCaption.Append(@"查询条件如下:"); if (!DataValidateManager.ValidateIsNull(HYBH.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("会员编号:"); sbCaption.Append(HYBH.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(HYXM.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("姓名:"); sbCaption.Append(HYXM.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(HYNC.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("昵称:"); sbCaption.Append(HYNC.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(HYSR.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("生日:"); sbCaption.Append(HYSR.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(HYSRBegin.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("生日开始值:"); sbCaption.Append(HYSRBegin.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(HYSREnd.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("生日结束值:"); sbCaption.Append(HYSREnd.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(HYXX.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("学校:"); sbCaption.Append(HYXX.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(HYBJ.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("班级:"); sbCaption.Append(HYBJ.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(JZXM.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("家长姓名:"); sbCaption.Append(JZXM.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(JZDH.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("家长电话:"); sbCaption.Append(JZDH.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(ZCSJ.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("注册时间:"); sbCaption.Append(ZCSJ.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(ZCSJBegin.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("注册时间开始值:"); sbCaption.Append(ZCSJBegin.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(ZCSJEnd.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("注册时间结束值:"); sbCaption.Append(ZCSJEnd.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(ZKSS.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("课时总数:"); sbCaption.Append(ZKSS.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(XHKSS.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("消耗课时:"); sbCaption.Append(XHKSS.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(SYKSS.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("剩余课时:"); sbCaption.Append(SYKSS.Text); sbCaption.Append(@"</div>"); } // 一对一相关表 sbCaption.Append("</div>"); return(sbCaption.ToString()); }
//===================================================================== // FunctionName : GetQueryInputParameter /// <summary> /// 得到查询用户输入参数操作(通过Request对象) /// </summary> //===================================================================== protected override Boolean GetQueryInputParameter() { Boolean boolReturn = true; ValidateData validateData = new ValidateData(); // 验证输入参数 validateData = ValidateHYBH(HYBH.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.HYBH = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateHYXM(HYXM.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.HYXM = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateHYNC(HYNC.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.HYNC = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateHYSRBegin(HYSRBegin.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.HYSRBegin = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateHYSREnd(HYSREnd.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.HYSREnd = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateHYSR(HYSR.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.HYSR = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateHYXX(HYXX.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.HYXX = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateHYBJ(HYBJ.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.HYBJ = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateJZXM(JZXM.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.JZXM = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateJZDH(JZDH.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.JZDH = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateZCSJBegin(ZCSJBegin.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.ZCSJBegin = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateZCSJEnd(ZCSJEnd.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.ZCSJEnd = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateZCSJ(ZCSJ.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.ZCSJ = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateZKSS(ZKSS.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.ZKSS = Convert.ToInt32(validateData.Value.ToString()); } } validateData = ValidateXHKSS(XHKSS.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.XHKSS = Convert.ToInt32(validateData.Value.ToString()); } } validateData = ValidateSYKSS(SYKSS.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.SYKSS = Convert.ToInt32(validateData.Value.ToString()); } } if (!DataValidateManager.ValidateIsNull(ViewState["QueryType"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["QueryType"].ToString())) { appData.QueryType = "AND"; } else { appData.QueryType = ViewState["QueryType"].ToString(); } } else { appData.SortField = "AND"; } if (!DataValidateManager.ValidateIsNull(ViewState["Sort"])) { if (!DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString())) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (!DataValidateManager.ValidateIsNull(ViewState["SortField"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString())) { appData.SortField = DEFAULT_SORT_FIELD; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = DEFAULT_SORT_FIELD; } if (!DataValidateManager.ValidateIsNull(ViewState["PageSize"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["PageSize"].ToString())) { appData.PageSize = DEFAULT_PAGE_SIZE; } else { appData.PageSize = Convert.ToInt32(ViewState["PageSize"].ToString()); } } else { appData.PageSize = DEFAULT_PAGE_SIZE; } if (!DataValidateManager.ValidateIsNull(ViewState["CurrentPage"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["CurrentPage"].ToString())) { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } else { appData.CurrentPage = Convert.ToInt32(ViewState["CurrentPage"].ToString()); } } else { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } return(boolReturn); }
private void ValidateUserLogin() { htInputParameter = new Hashtable(); htInputParameter.Add("UserLoginName", txtUserLoginName.Text); htInputParameter.Add("Password", txtPassword.Text); htInputParameter.Add("LastLoginIP", Request.ServerVariables["REMOTE_ADDR"]); htInputParameter.Add("lcodeFromUrl", Request.QueryString["lcode"]); htInputParameter.Add("UserID", null); htInputParameter.Add("UserGroupID", null); htInputParameter.Add("UserNickName", null); //对输入参数进行检验 if (ValidateInputParameter() || !DataValidateManager.ValidateIsNull(Request.Cookies[ConstantsManager.COOKIE_SAVE_LOGIN_STATUS])) { if (((string)htInputParameter["Password"]).Length != 32) { htInputParameter["Password"] = SecurityManager.MD5(htInputParameter["Password"].ToString(), 32); } htOutputParameter = SystemValidateLibrary.ValidateUserLogin(htInputParameter); if (htOutputParameter[ConstantsManager.MESSAGE_ID] == DBNull.Value) { //初始化用户登录数据登录 Session[ConstantsManager.SESSION_USER_ID] = htOutputParameter["UserID"].ToString(); Session[ConstantsManager.SESSION_USER_GROUP_ID] = htOutputParameter["UserGroupID"].ToString(); Session[ConstantsManager.SESSION_USER_LOGIN_NAME] = htOutputParameter["UserLoginName"].ToString(); Session[ConstantsManager.SESSION_USER_NICK_NAME] = htOutputParameter["UserNickName"].ToString(); Session[ConstantsManager.SESSION_SSDW_ID] = htOutputParameter["SubjectID"].ToString(); Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_USER_ID, Server.UrlEncode(htOutputParameter["UserID"].ToString()))); Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_USER_GROUP_ID, Server.UrlEncode(htOutputParameter["UserGroupID"].ToString()))); Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_USER_LOGIN_NAME, Server.UrlEncode(htOutputParameter["UserLoginName"].ToString()))); Response.Cookies[ConstantsManager.COOKIE_USER_LOGIN_NAME].Expires = DateTime.Now.AddDays(20); Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_USER_NICK_NAME, Server.UrlEncode(htOutputParameter["UserNickName"].ToString()))); Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_SSDW_ID, Server.UrlEncode(htOutputParameter["SubjectID"].ToString()))); if (chkSaveLoginStatus.Checked) { Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_PASSWORD, Server.UrlEncode((string)htInputParameter["Password"]))); Response.Cookies[ConstantsManager.COOKIE_PASSWORD].Expires = DateTime.Now.AddDays(180); Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_SAVE_LOGIN_STATUS, Server.UrlEncode("true"))); Response.Cookies[ConstantsManager.COOKIE_SAVE_LOGIN_STATUS].Expires = DateTime.Now.AddDays(180); } //得到登录成功消息 strMessageInfo = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0001, strMessageInfo); //记录日志开始 string strLogTypeID = "A01"; strMessageParam[0] = htOutputParameter["UserLoginName"].ToString(); string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0001, strMessageParam); LogLibrary.LogWrite(strLogTypeID, strLogContent, null, null, null); //记录日志结束 //添加用户在线信息开始 // RICH.Common.BM.T_PM_UserOnlineInfo.T_PM_UserOnlineInfoApplicationData appData = new RICH.Common.BM.T_PM_UserOnlineInfo.T_PM_UserOnlineInfoApplicationData(); // RICH.Common.BM.T_PM_UserOnlineInfo.T_PM_UserOnlineInfoApplicationLogic instanceT_PM_UserOnlineInfoApplicationLogic //= (RICH.Common.BM.T_PM_UserOnlineInfo.T_PM_UserOnlineInfoApplicationLogic)CreateApplicationLogicInstance(typeof(RICH.Common.BM.T_PM_UserOnlineInfo.T_PM_UserOnlineInfoApplicationLogic)); // appData.UserID = (string)Session[ConstantsManager.SESSION_USER_ID]; // appData.OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.PK; // instanceT_PM_UserOnlineInfoApplicationLogic.Delete(appData); // appData.AccessDate = DateTime.Now; // appData.AccessIP = RICH.Common.IM.IPAddessLibrary.GetRemoteTrueIP(); // //appData.AccessLocation = RICH.Common.IM.IPAddessLibrary.GetLocationFromIP(appData.AccessIP.ToString()); // appData = instanceT_PM_UserOnlineInfoApplicationLogic.Add(appData); //添加用户在线信息结束 //对正确消息进行处理 Response.Write(strMessageInfo); Response.Redirect(this.IsMobileDevice() && chkSaveLoginStatus.Checked ? "Default.aspx?lcode={0}".FormatInvariantCulture(htOutputParameter["lcode"]) : "Default.aspx"); } else { //记录日志开始 string strLogTypeID = "A01"; strMessageParam[0] = htOutputParameter["UserLoginName"].ToString(); string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0002, strMessageParam); LogLibrary.LogWrite(strLogTypeID, strLogContent, null, null, null); //记录日志结束 strMessageInfo = MessageManager.GetMessageInfo((string)htOutputParameter[ConstantsManager.MESSAGE_ID], strMessageInfo); //对错误消息进行处理 Session.Remove(ConstantsManager.SESSION_CURRENT_PURVIEW); MessageLabel.Text = strMessageInfo; } } else { //对错误消息进行处理 Session.Remove(ConstantsManager.SESSION_CURRENT_PURVIEW); MessageLabel.Text = strMessageInfo; } }
protected void btnInfoFromDS_Click(object sender, EventArgs e) { int totalCount = 0; int importCount = 0; int updateCount = 0; try { var appDatas = T_BG_0601ApplicationData.GetDataFromDataFile <T_BG_0601ApplicationData>(InfoFromDoc.Text, true, true, recordStartLine: T_BG_0601Contants.ImportDataSetStartLineNum); T_BG_0601ApplicationLogic instanceT_BG_0601ApplicationLogic = (T_BG_0601ApplicationLogic)CreateApplicationLogicInstance(typeof(T_BG_0601ApplicationLogic)); totalCount = appDatas.Count; foreach (var app in appDatas) { app.FBH = instanceT_BG_0601ApplicationLogic.AutoGenerateFBH(app); if (!BT.Text.IsHtmlNullOrWiteSpace()) { app.BT = Convert.ToString(BT.Text); } string strFBLM = GetValue(new RICH.Common.BM.T_BG_0602.T_BG_0602ApplicationLogicBase().GetValueByFixCondition("LMM", app.FBLM, "LMH")); if (!DataValidateManager.ValidateIsNull(strFBLM)) { app.FBLM = strFBLM; } if (!FBLM.SelectedValue.IsHtmlNullOrWiteSpace()) { app.FBLM = Convert.ToString(FBLM.SelectedValue); } string strFBBM = GetValue(new RICH.Common.BM.T_BM_DWXX.T_BM_DWXXApplicationLogicBase().GetValueByFixCondition("DWMC", app.FBBM, "DWBH")); if (!DataValidateManager.ValidateIsNull(strFBBM)) { app.FBBM = strFBBM; } if (!FBBM.SelectedValue.IsHtmlNullOrWiteSpace()) { app.FBBM = Convert.ToString(FBBM.SelectedValue); } string strXXLX = GetValue(new RICH.Common.BM.Dictionary.DictionaryApplicationLogicBase().GetValueByFixCondition("MC", app.XXLX, "DM")); if (!DataValidateManager.ValidateIsNull(strXXLX)) { app.XXLX = strXXLX; } if (!XXLX.SelectedValue.IsHtmlNullOrWiteSpace()) { app.XXLX = Convert.ToString(XXLX.SelectedValue); } if (!XXTPDZ.Text.IsHtmlNullOrWiteSpace()) { app.XXTPDZ = Convert.ToString(XXTPDZ.Text); } if (!XXNR.Text.IsHtmlNullOrWiteSpace()) { app.XXNR = Convert.ToString(XXNR.Text); } if (!FJXZDZ.Text.IsHtmlNullOrWiteSpace()) { app.FJXZDZ = Convert.ToString(FJXZDZ.Text); } app.XXZT = "02"; string strXXZT = GetValue(new RICH.Common.BM.Dictionary.DictionaryApplicationLogicBase().GetValueByFixCondition("MC", app.XXZT, "DM")); if (!DataValidateManager.ValidateIsNull(strXXZT)) { app.XXZT = strXXZT; } string strIsTop = GetValue(new RICH.Common.BM.Dictionary.DictionaryApplicationLogicBase().GetValueByFixCondition("MC", app.IsTop, "DM")); if (!DataValidateManager.ValidateIsNull(strIsTop)) { app.IsTop = strIsTop; } if (!IsTop.SelectedValue.IsHtmlNullOrWiteSpace()) { app.IsTop = Convert.ToString(IsTop.SelectedValue); } if (!TopSort.Text.IsHtmlNullOrWiteSpace()) { app.TopSort = Convert.ToInt32(TopSort.Text); } string strIsBest = GetValue(new RICH.Common.BM.Dictionary.DictionaryApplicationLogicBase().GetValueByFixCondition("MC", app.IsBest, "DM")); if (!DataValidateManager.ValidateIsNull(strIsBest)) { app.IsBest = strIsBest; } if (!IsBest.SelectedValue.IsHtmlNullOrWiteSpace()) { app.IsBest = Convert.ToString(IsBest.SelectedValue); } app.FBRJGH = (string)Session[ConstantsManager.SESSION_USER_ID]; string strFBRJGH = GetValue(new RICH.Common.BM.T_PM_UserInfo.T_PM_UserInfoApplicationLogicBase().GetValueByFixCondition("UserNickName", app.FBRJGH, "UserID")); if (!DataValidateManager.ValidateIsNull(strFBRJGH)) { app.FBRJGH = strFBRJGH; } app.FBSJRQ = DateTime.Now; app.FBIP = (string)Request.ServerVariables["REMOTE_ADDR"]; instanceT_BG_0601ApplicationLogic.Add(app); if (app.ResultCode == RICH.Common.Base.ApplicationData.ApplicationDataBase.ResultState.Succeed) { importCount++; } else { app.OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.PK; instanceT_BG_0601ApplicationLogic.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); } }
protected void btnInfoFromDS_Click(object sender, EventArgs e) { int totalCount = 0; int importCount = 0; int updateCount = 0; try { var appDatas = T_BM_DWXXApplicationData.GetDataFromDataFile <T_BM_DWXXApplicationData>(InfoFromDoc.Text, true, true, recordStartLine: T_BM_DWXXContants.ImportDataSetStartLineNum); T_BM_DWXXApplicationLogic instanceT_BM_DWXXApplicationLogic = (T_BM_DWXXApplicationLogic)CreateApplicationLogicInstance(typeof(T_BM_DWXXApplicationLogic)); totalCount = appDatas.Count; foreach (var app in appDatas) { app.DWBH = instanceT_BM_DWXXApplicationLogic.AutoGenerateDWBH(app); if (!DWMC.Text.IsHtmlNullOrWiteSpace()) { app.DWMC = Convert.ToString(DWMC.Text); } string strSJDWBH = GetValue(new RICH.Common.BM.T_BM_DWXX.T_BM_DWXXApplicationLogicBase().GetValueByFixCondition("DWMC", app.SJDWBH, "DWBH")); if (!DataValidateManager.ValidateIsNull(strSJDWBH)) { app.SJDWBH = strSJDWBH; } if (!SJDWBH.SelectedValue.IsHtmlNullOrWiteSpace()) { app.SJDWBH = Convert.ToString(SJDWBH.SelectedValue); } if (!DZ.Text.IsHtmlNullOrWiteSpace()) { app.DZ = Convert.ToString(DZ.Text); } if (!YB.Text.IsHtmlNullOrWiteSpace()) { app.YB = Convert.ToString(YB.Text); } if (!LXBM.Text.IsHtmlNullOrWiteSpace()) { app.LXBM = Convert.ToString(LXBM.Text); } if (!LXDH.Text.IsHtmlNullOrWiteSpace()) { app.LXDH = Convert.ToString(LXDH.Text); } if (!Email.Text.IsHtmlNullOrWiteSpace()) { app.Email = Convert.ToString(Email.Text); } if (!LXR.Text.IsHtmlNullOrWiteSpace()) { app.LXR = Convert.ToString(LXR.Text); } if (!SJ.Text.IsHtmlNullOrWiteSpace()) { app.SJ = Convert.ToString(SJ.Text); } instanceT_BM_DWXXApplicationLogic.Add(app); if (app.ResultCode == RICH.Common.Base.ApplicationData.ApplicationDataBase.ResultState.Succeed) { importCount++; } else { app.OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.PK; instanceT_BM_DWXXApplicationLogic.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); } }
protected override Boolean GetQueryInputParameter() { Boolean boolReturn = true; ValidateData validateData = new ValidateData(); // 验证输入参数 validateData = ValidateDXXBT(Request["DXXBT"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.DXXBT = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateDXXNR(Request["DXXNR"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.DXXNR = Convert.ToString(validateData.Value.ToString()); } } if (!string.IsNullOrWhiteSpace(Request["SearchKeywords"])) { appData.DXXBT = Convert.ToString(Request["SearchKeywords"]); } if (!DataValidateManager.ValidateIsNull(ViewState["QueryType"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["QueryType"].ToString())) { appData.QueryType = "AND"; } else { appData.QueryType = ViewState["QueryType"].ToString(); } } else { appData.SortField = "AND"; } if (!DataValidateManager.ValidateIsNull(ViewState["Sort"])) { if (!DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString())) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (!DataValidateManager.ValidateIsNull(ViewState["SortField"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString())) { appData.SortField = DEFAULT_SORT_FIELD; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = DEFAULT_SORT_FIELD; } if (!DataValidateManager.ValidateIsNull(ViewState["PageSize"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["PageSize"].ToString())) { appData.PageSize = DEFAULT_PAGE_SIZE; } else { appData.PageSize = Convert.ToInt32(ViewState["PageSize"].ToString()); } } else { appData.PageSize = DEFAULT_PAGE_SIZE; } if (!DataValidateManager.ValidateIsNull(ViewState["CurrentPage"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["CurrentPage"].ToString())) { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } else { appData.CurrentPage = Convert.ToInt32(ViewState["CurrentPage"].ToString()); } } else { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } if (CustomPermission == SJX_PURVIEW_ID) { appData.DXXLX = "02"; } if (CustomPermission == SJX_PURVIEW_ID) { appData.JSR = CurrentUserInfo.UserID; } if (CustomPermission == FJX_PURVIEW_ID) { appData.DXXLX = "01"; } if (CustomPermission == FJX_PURVIEW_ID) { appData.FSR = CurrentUserInfo.UserID; } return(boolReturn); }
//===================================================================== // FunctionName : GetQueryInputParameter /// <summary> /// 得到查询用户输入参数操作(通过Request对象) /// </summary> //===================================================================== protected override Boolean GetQueryInputParameter() { Boolean boolReturn = true; ValidateData validateData = new ValidateData(); // 验证输入参数 validateData = ValidateDXXBT(DXXBT.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.DXXBT = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateDXXNR(DXXNR.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.DXXNR = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateFSSJBegin(FSSJBegin.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.FSSJBegin = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateFSSJEnd(FSSJEnd.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.FSSJEnd = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateFSSJ(FSSJ.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.FSSJ = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateFSR(FSR.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.FSR = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateFSBM(FSBM.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.FSBM = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateJSRBatch(JSR.SelectedValues, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.JSRBatch = Convert.ToString(validateData.Value.ToString()); } } if (!DataValidateManager.ValidateIsNull(ViewState["QueryType"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["QueryType"].ToString())) { appData.QueryType = "AND"; } else { appData.QueryType = ViewState["QueryType"].ToString(); } } else { appData.SortField = "AND"; } if (!DataValidateManager.ValidateIsNull(ViewState["Sort"])) { if (!DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString())) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (!DataValidateManager.ValidateIsNull(ViewState["SortField"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString())) { appData.SortField = DEFAULT_SORT_FIELD; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = DEFAULT_SORT_FIELD; } if (!DataValidateManager.ValidateIsNull(ViewState["PageSize"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["PageSize"].ToString())) { appData.PageSize = DEFAULT_PAGE_SIZE; } else { appData.PageSize = Convert.ToInt32(ViewState["PageSize"].ToString()); } } else { appData.PageSize = DEFAULT_PAGE_SIZE; } if (!DataValidateManager.ValidateIsNull(ViewState["CurrentPage"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["CurrentPage"].ToString())) { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } else { appData.CurrentPage = Convert.ToInt32(ViewState["CurrentPage"].ToString()); } } else { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } if (CustomPermission == SJX_PURVIEW_ID) { appData.DXXLX = "02"; } if (CustomPermission == SJX_PURVIEW_ID) { appData.JSR = CurrentUserInfo.UserID; } if (CustomPermission == FJX_PURVIEW_ID) { appData.DXXLX = "01"; } if (CustomPermission == FJX_PURVIEW_ID) { appData.FSR = CurrentUserInfo.UserID; } return(boolReturn); }
//===================================================================== // FunctionName : GetTableCaption /// <summary> /// 得到信息标题 /// </summary> //===================================================================== private string GetTableCaption() { System.Text.StringBuilder sbCaption = new System.Text.StringBuilder(string.Empty); sbCaption.Append(@"<div class=""caption"">"); sbCaption.Append(@"报名信息列表"); sbCaption.Append(@"</div>"); sbCaption.Append(@"<div class=""captionnote"">"); sbCaption.Append(@"查询条件如下:"); if (!DataValidateManager.ValidateIsNull(BMBH.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("报名编号:"); sbCaption.Append(BMBH.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(HYBH.SelectedValue)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("会员编号:"); sbCaption.Append(new RICH.Common.BM.T_BM_HYXX.T_BM_HYXXBusinessEntity().GetValueByFixCondition("HYBH", HYBH.SelectedValue, "HYXM")); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(SKR.SelectedValue)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("收款人:"); sbCaption.Append(new RICH.Common.BM.T_PM_UserInfo.T_PM_UserInfoBusinessEntity().GetValueByFixCondition("UserID", SKR.SelectedValue, "UserNickName")); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(BMSJ.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("报名时间:"); sbCaption.Append(BMSJ.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(BMSJBegin.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("报名时间开始值:"); sbCaption.Append(BMSJBegin.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(BMSJEnd.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("报名时间结束值:"); sbCaption.Append(BMSJEnd.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(LRR.SelectedValue)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("登记人:"); sbCaption.Append(new RICH.Common.BM.T_PM_UserInfo.T_PM_UserInfoBusinessEntity().GetValueByFixCondition("UserID", LRR.SelectedValue, "UserNickName")); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(LRSJ.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("登记时间:"); sbCaption.Append(LRSJ.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(LRSJBegin.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("登记时间开始值:"); sbCaption.Append(LRSJBegin.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(LRSJEnd.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("登记时间结束值:"); sbCaption.Append(LRSJEnd.Text); sbCaption.Append(@"</div>"); } // 一对一相关表 sbCaption.Append("</div>"); return(sbCaption.ToString()); }
protected virtual Boolean GetCountInputParameter() { Boolean boolReturn = true; // 验证输入参数 if (ValidateRequestParamter() == true) { if (DataValidateManager.ValidateIsNull(Request["CountField"]) == false) { if (DataValidateManager.ValidateStringLengthRange(Request["CountField"].ToString(), 1, 50) == false) { strMessageParam[0] = "统计方式"; strMessageParam[1] = "1"; strMessageParam[2] = "50"; strMessageInfo = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0004, strMessageParam, strMessageInfo); boolReturn = false; } else { appData.CountField = Request["CountField"].ToString(); } } else { strMessageParam[0] = "统计方式"; strMessageInfo = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0002, strMessageParam, strMessageInfo); boolReturn = false; } if (DataValidateManager.ValidateIsNull(ViewState["Sort"]) == false) { if (DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString()) == false) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (DataValidateManager.ValidateIsNull(ViewState["SortField"]) == false) { if (DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString()) == false) { appData.SortField = "RecordID"; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = "RecordID"; } } else { // 记录日志开始 string strLogTypeID = "A04"; strMessageParam[0] = (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME]; string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0009, strMessageParam); LogLibrary.LogWrite(strLogTypeID, strLogContent, null, null, null); // 记录日志结束 // 对错误消息进行处理 strMessageInfo = MessageManager.GetMessageInfo(MessageManager.ERR_MSGID_0027, strMessageInfo); MessageContent = strMessageInfo; Session[ConstantsManager.SESSION_MESSAGE_TYPE] = "FaildPre"; Response.Redirect(ConstantsManager.WEBSITE_VIRTUAL_ROOT_DIR + "/ErrorPage/CommonErrorPage.aspx"); Response.End(); } return(boolReturn); }
//===================================================================== // FunctionName : GetQueryInputParameter /// <summary> /// 得到查询用户输入参数操作(通过Request对象) /// </summary> //===================================================================== protected override Boolean GetQueryInputParameter() { Boolean boolReturn = true; ValidateData validateData = new ValidateData(); // 验证输入参数 validateData = ValidateUserGroupID(UserGroupID.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.UserGroupID = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateUserGroupName(UserGroupName.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.UserGroupName = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateUserGroupContent(UserGroupContent.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.UserGroupContent = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateUserGroupRemark(UserGroupRemark.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.UserGroupRemark = Convert.ToString(validateData.Value.ToString()); } } if (!DataValidateManager.ValidateIsNull(ViewState["QueryType"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["QueryType"].ToString())) { appData.QueryType = "AND"; } else { appData.QueryType = ViewState["QueryType"].ToString(); } } else { appData.SortField = "AND"; } if (!DataValidateManager.ValidateIsNull(ViewState["Sort"])) { if (!DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString())) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (!DataValidateManager.ValidateIsNull(ViewState["SortField"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString())) { appData.SortField = DEFAULT_SORT_FIELD; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = DEFAULT_SORT_FIELD; } if (!DataValidateManager.ValidateIsNull(ViewState["PageSize"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["PageSize"].ToString())) { appData.PageSize = DEFAULT_PAGE_SIZE; } else { appData.PageSize = Convert.ToInt32(ViewState["PageSize"].ToString()); } } else { appData.PageSize = DEFAULT_PAGE_SIZE; } if (!DataValidateManager.ValidateIsNull(ViewState["CurrentPage"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["CurrentPage"].ToString())) { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } else { appData.CurrentPage = Convert.ToInt32(ViewState["CurrentPage"].ToString()); } } else { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } return(boolReturn); }
protected virtual ValidateData ValidateSM(object objValidateData, bool boolNullable, bool boolExist) { ValidateData validateData = new ValidateData(); try { // 初始化参数 validateData.Result = true; validateData.Message = string.Empty; validateData.Parameters = new string[5]; validateData.IsNull = false; validateData.IsExist = false; // 传入参数赋值 validateData.Value = objValidateData; validateData.Nullable = boolNullable; validateData.Exist = boolExist; validateData.Parameters[0] = "说明"; validateData.Parameters[1] = "1"; validateData.Parameters[2] = "255"; // 空验证 if (DataValidateManager.ValidateIsNull(validateData.Value) == false) { // 数值格式验证 if (DataValidateManager.ValidateStringLengthRange(validateData.Value, 1, 255) == false) { validateData.Message = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0004, validateData.Parameters); validateData.Result = false; } else { // 数据存在验证 if (validateData.Exist == true) { if (AJAX_IsExist("SM", validateData.Value.ToString()) == true) { validateData.IsExist = true; validateData.Message = @"说明已存在,请再换一个。"; validateData.Result = false; } else { validateData.Message = @"说明不存在,可以使用。"; validateData.Result = true; } } else { validateData.Result = true; } } } else { validateData.IsNull = true; if (validateData.Nullable == false) { validateData.Message = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0002, validateData.Parameters); validateData.Result = false; } } } catch (Exception) { validateData.Result = false; } return(validateData); }
protected override Boolean GetQueryInputParameter() { Boolean boolReturn = true; ValidateData validateData = new ValidateData(); // 验证输入参数 validateData = ValidateUserLoginName(Request["UserLoginName"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.UserLoginName = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateSubjectIDBatch(Request["SubjectID"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.SubjectIDBatch = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateSubjectID(Request["SubjectID"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.SubjectID = null; appData.SubjectIDBatch = GetSubItem_SubjectID(validateData.Value.ToString()) + "," + validateData.Value.ToString(); } } validateData = ValidateUserNickName(Request["UserNickName"], true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.UserNickName = Convert.ToString(validateData.Value.ToString()); } } if (!string.IsNullOrWhiteSpace(Request["SearchKeywords"])) { appData.UserNickName = Convert.ToString(Request["SearchKeywords"]); } if (!DataValidateManager.ValidateIsNull(ViewState["QueryType"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["QueryType"].ToString())) { appData.QueryType = "AND"; } else { appData.QueryType = ViewState["QueryType"].ToString(); } } else { appData.SortField = "AND"; } if (!DataValidateManager.ValidateIsNull(ViewState["Sort"])) { if (!DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString())) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (!DataValidateManager.ValidateIsNull(ViewState["SortField"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString())) { appData.SortField = DEFAULT_SORT_FIELD; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = DEFAULT_SORT_FIELD; } if (!DataValidateManager.ValidateIsNull(ViewState["PageSize"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["PageSize"].ToString())) { appData.PageSize = DEFAULT_PAGE_SIZE; } else { appData.PageSize = Convert.ToInt32(ViewState["PageSize"].ToString()); } } else { appData.PageSize = DEFAULT_PAGE_SIZE; } if (!DataValidateManager.ValidateIsNull(ViewState["CurrentPage"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["CurrentPage"].ToString())) { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } else { appData.CurrentPage = Convert.ToInt32(ViewState["CurrentPage"].ToString()); } } else { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } return(boolReturn); }
//===================================================================== // FunctionName : GetQueryInputParameter /// <summary> /// 得到查询用户输入参数操作(通过Request对象) /// </summary> //===================================================================== protected override Boolean GetQueryInputParameter() { Boolean boolReturn = true; ValidateData validateData = new ValidateData(); // 验证输入参数 validateData = ValidateKCBBH(KCBBH.SelectedValue, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.KCBBH = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateHYBH(HYBH.SelectedValue, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.HYBH = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateYYSJBegin(YYSJBegin.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.YYSJBegin = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateYYSJEnd(YYSJEnd.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.YYSJEnd = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateYYSJ(YYSJ.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.YYSJ = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidateYYBZ(YYBZ.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.YYBZ = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidateSKZT(SKZT.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.SKZT = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidatePJR(PJR.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.PJR = Convert.ToString(validateData.Value.ToString()); } } validateData = ValidatePJSJBegin(PJSJBegin.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.PJSJBegin = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidatePJSJEnd(PJSJEnd.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.PJSJEnd = Convert.ToDateTime(validateData.Value.ToString()); } } validateData = ValidatePJSJ(PJSJ.Text, true, false); if (validateData.Result) { if (!validateData.IsNull) { appData.PJSJ = Convert.ToDateTime(validateData.Value.ToString()); } } if (!DataValidateManager.ValidateIsNull(ViewState["QueryType"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["QueryType"].ToString())) { appData.QueryType = "AND"; } else { appData.QueryType = ViewState["QueryType"].ToString(); } } else { appData.SortField = "AND"; } if (!DataValidateManager.ValidateIsNull(ViewState["Sort"])) { if (!DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString())) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (!DataValidateManager.ValidateIsNull(ViewState["SortField"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString())) { appData.SortField = DEFAULT_SORT_FIELD; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = DEFAULT_SORT_FIELD; } if (!DataValidateManager.ValidateIsNull(ViewState["PageSize"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["PageSize"].ToString())) { appData.PageSize = DEFAULT_PAGE_SIZE; } else { appData.PageSize = Convert.ToInt32(ViewState["PageSize"].ToString()); } } else { appData.PageSize = DEFAULT_PAGE_SIZE; } if (!DataValidateManager.ValidateIsNull(ViewState["CurrentPage"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["CurrentPage"].ToString())) { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } else { appData.CurrentPage = Convert.ToInt32(ViewState["CurrentPage"].ToString()); } } else { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } if (CustomPermission == WDYY_PURVIEW_ID) { appData.HYBH = CurrentUserInfo.UserID; } if (CustomPermission == WDPY_PURVIEW_ID) { appData.PJR = CurrentUserInfo.UserID; } return(boolReturn); }
//***************************************************** // Function Name: QueryRecordInfo /// <summary> /// 根据条件查询记录 /// </summary> // Writer: 王景璐 // Create Date: 2007/04/09 //****************************************************** private void QueryRecordInfo() { htInputParameter = new Hashtable(); dsRecordInfo = new DataSet(); htInputParameter.Add(ConstantsManager.QUERY_DATASET_NAME, dsRecordInfo); htInputParameter.Add(ConstantsManager.MESSAGE_ID, ""); if (Request["Sort"] == "" || Request["Sort"] == null) { htInputParameter.Add("Sort", DEFAULT_SORT); } else { htInputParameter.Add("Sort", Request["Sort"]); } if (Request["SortField"] == "" || Request["SortField"] == null) { htInputParameter.Add("SortField", DEFAULT_SORT_FIELD); } else { htInputParameter.Add("SortField", Request["SortField"]); } if (DataValidateManager.ValidateIsNull(ViewState["PageSize"]) == true) { htInputParameter.Add("PageSize", DEFAULT_PAGE_SIZE); } else { htInputParameter.Add("PageSize", ViewState["PageSize"].ToString()); } if (DataValidateManager.ValidateIsNull(ViewState["CurrentPage"]) == true) { htInputParameter.Add("CurrentPage", DEFAULT_CURRENT_PAGE); } else { htInputParameter.Add("CurrentPage", ViewState["CurrentPage"].ToString()); } if (DataValidateManager.ValidateIsNull(ViewState["ObjectID"]) == false) { htInputParameter.Add("ObjectID", ViewState["ObjectID"].ToString()); } if (DataValidateManager.ValidateIsNull(ViewState["UserGroupID"]) == false) { htInputParameter.Add("UserGroupID", ViewState["UserGroupID"].ToString()); } if (DataValidateManager.ValidateIsNull(ViewState["UserGroupName"]) == false) { htInputParameter.Add("UserGroupName", ViewState["UserGroupName"].ToString()); } if (DataValidateManager.ValidateIsNull(ViewState["UserGroupContent"]) == false) { htInputParameter.Add("UserGroupContent", ViewState["UserGroupContent"].ToString()); } if (DataValidateManager.ValidateIsNull(ViewState["UserGroupRemark"]) == false) { htInputParameter.Add("UserGroupRemark", ViewState["UserGroupRemark"].ToString()); } if (ValidateQueryInputParameter()) { UserGroupLibrary instanceUserGroupLibrary = new UserGroupLibrary(); htOutputParameter = instanceUserGroupLibrary.SelectRecordInfo(htInputParameter); dsRecordInfo = (DataSet)htOutputParameter[ConstantsManager.QUERY_DATASET_NAME]; intRecordCount = (int)htOutputParameter[ConstantsManager.RECORD_COUNT]; gvRecordList.DataSource = dsRecordInfo; gvRecordList.DataBind(); } else { //对错误消息进行处理 MessageContent = strMessageInfo; } }
protected override Boolean GetQueryInputParameter() { Boolean boolReturn = true; ValidateData validateData = new ValidateData(); // 验证输入参数 if (!string.IsNullOrWhiteSpace(Request["SearchKeywords"])) { appData.DM = Convert.ToString(Request["SearchKeywords"]); } if (!DataValidateManager.ValidateIsNull(ViewState["QueryType"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["QueryType"].ToString())) { appData.QueryType = "AND"; } else { appData.QueryType = ViewState["QueryType"].ToString(); } } else { appData.SortField = "AND"; } if (!DataValidateManager.ValidateIsNull(ViewState["Sort"])) { if (!DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString())) { appData.Sort = DEFAULT_SORT; } else { appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString()); } } else { appData.Sort = DEFAULT_SORT; } if (!DataValidateManager.ValidateIsNull(ViewState["SortField"])) { if (!DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString())) { appData.SortField = DEFAULT_SORT_FIELD; } else { appData.SortField = ViewState["SortField"].ToString(); } } else { appData.SortField = DEFAULT_SORT_FIELD; } if (!DataValidateManager.ValidateIsNull(ViewState["PageSize"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["PageSize"].ToString())) { appData.PageSize = DEFAULT_PAGE_SIZE; } else { appData.PageSize = Convert.ToInt32(ViewState["PageSize"].ToString()); } } else { appData.PageSize = DEFAULT_PAGE_SIZE; } if (!DataValidateManager.ValidateIsNull(ViewState["CurrentPage"])) { if (!DataValidateManager.ValidateNumberFormat(ViewState["CurrentPage"].ToString())) { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } else { appData.CurrentPage = Convert.ToInt32(ViewState["CurrentPage"].ToString()); } } else { appData.CurrentPage = DEFAULT_CURRENT_PAGE; } return(boolReturn); }
private Boolean ValidateQueryInputParameter() { Boolean boolReturn = true; if (DataValidateManager.ValidateIsNull(htInputParameter["UserGroupID"]) == false) { if (DataValidateManager.ValidateStringLengthRange(htInputParameter["UserGroupID"], 0, 50) == false) { strMessageParam[0] = "用户组编号"; strMessageInfo = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0004, strMessageParam, strMessageInfo); boolReturn = false; } } else { htInputParameter.Remove("UserGroupID"); } //UserGroupName输入检验 if (DataValidateManager.ValidateIsNull(htInputParameter["UserGroupName"]) == false) { if (DataValidateManager.ValidateStringLengthRange(htInputParameter["UserGroupName"], 0, 50) == false) { strMessageParam[0] = "用户组名称"; strMessageInfo = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0004, strMessageParam, strMessageInfo); boolReturn = false; } } else { htInputParameter.Remove("UserGroupName"); } //UserGroupContent输入检验 if (DataValidateManager.ValidateIsNull(htInputParameter["UserGroupContent"]) == false) { if (DataValidateManager.ValidateStringLengthRange(htInputParameter["UserGroupContent"], 0, 50) == false) { strMessageParam[0] = "用户组内容"; strMessageParam[1] = "0"; strMessageParam[2] = "50"; strMessageInfo = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0004, strMessageParam, strMessageInfo); boolReturn = false; } } else { htInputParameter.Remove("UserGroupContent"); } //UserGroupRemark输入检验 if (DataValidateManager.ValidateIsNull(htInputParameter["UserGroupRemark"]) == false) { if (DataValidateManager.ValidateStringLengthRange(htInputParameter["UserGroupRemark"], 0, 255) == false) { strMessageParam[0] = "用户组备注"; strMessageParam[1] = "0"; strMessageParam[2] = "50"; strMessageInfo = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0004, strMessageParam, strMessageInfo); boolReturn = false; } } else { htInputParameter.Remove("UserGroupRemark"); } return(boolReturn); }
protected void btnInfoFromDS_Click(object sender, EventArgs e) { int totalCount = 0; int importCount = 0; int updateCount = 0; try { var appDatas = T_BM_KCBXXApplicationData.GetDataFromDataFile <T_BM_KCBXXApplicationData>(InfoFromDoc.Text, true, true, recordStartLine: T_BM_KCBXXContants.ImportDataSetStartLineNum); T_BM_KCBXXApplicationLogic instanceT_BM_KCBXXApplicationLogic = (T_BM_KCBXXApplicationLogic)CreateApplicationLogicInstance(typeof(T_BM_KCBXXApplicationLogic)); totalCount = appDatas.Count; foreach (var app in appDatas) { app.KCBBH = instanceT_BM_KCBXXApplicationLogic.AutoGenerateKCBBH(app); string strKCXLBH = GetValue(new RICH.Common.BM.T_BM_KCXLXX.T_BM_KCXLXXApplicationLogicBase().GetValueByFixCondition("KCXLMC", app.KCXLBH, "KCXLBH")); if (!DataValidateManager.ValidateIsNull(strKCXLBH)) { app.KCXLBH = strKCXLBH; } if (!KCXLBH.SelectedValue.IsHtmlNullOrWiteSpace()) { app.KCXLBH = Convert.ToString(KCXLBH.SelectedValue); } string strKCBH = GetValue(new RICH.Common.BM.T_BM_KCXX.T_BM_KCXXApplicationLogicBase().GetValueByFixCondition("KCMC", app.KCBH, "KCBH")); if (!DataValidateManager.ValidateIsNull(strKCBH)) { app.KCBH = strKCBH; } if (!KCBH.SelectedValue.IsHtmlNullOrWiteSpace()) { app.KCBH = Convert.ToString(KCBH.SelectedValue); } if (!KCSJ.Text.IsHtmlNullOrWiteSpace()) { app.KCSJ = Convert.ToDateTime(KCSJ.Text); } if (!KSS.Text.IsHtmlNullOrWiteSpace()) { app.KSS = Convert.ToInt32(KSS.Text); } string strSKJS = GetValue(new RICH.Common.BM.T_PM_UserInfo.T_PM_UserInfoApplicationLogicBase().GetValueByFixCondition("UserNickName", app.SKJS, "UserID")); if (!DataValidateManager.ValidateIsNull(strSKJS)) { app.SKJS = strSKJS; } if (!SKJS.SelectedValue.IsHtmlNullOrWiteSpace()) { app.SKJS = Convert.ToString(SKJS.SelectedValue); } if (!SKFJ.Text.IsHtmlNullOrWiteSpace()) { app.SKFJ = Convert.ToString(SKFJ.Text); } instanceT_BM_KCBXXApplicationLogic.Add(app); if (app.ResultCode == RICH.Common.Base.ApplicationData.ApplicationDataBase.ResultState.Succeed) { importCount++; } else { app.OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.PK; instanceT_BM_KCBXXApplicationLogic.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); } }
//===================================================================== // FunctionName : GetTableCaption /// <summary> /// 得到信息标题 /// </summary> //===================================================================== private string GetTableCaption() { System.Text.StringBuilder sbCaption = new System.Text.StringBuilder(string.Empty); sbCaption.Append(@"<div class=""caption"">"); sbCaption.Append(@"课程表列表"); sbCaption.Append(@"</div>"); sbCaption.Append(@"<div class=""captionnote"">"); sbCaption.Append(@"查询条件如下:"); if (!DataValidateManager.ValidateIsNull(KCXLBH.SelectedValues)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("课程系列:"); sbCaption.Append(new RICH.Common.BM.T_BM_KCXLXX.T_BM_KCXLXXBusinessEntity().GetValueByFixCondition("KCXLBH", KCXLBH.SelectedValues, "KCXLMC")); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(KCBH.SelectedValue)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("课程:"); sbCaption.Append(new RICH.Common.BM.T_BM_KCXX.T_BM_KCXXBusinessEntity().GetValueByFixCondition("KCBH", KCBH.SelectedValue, "KCMC")); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(KCSJ.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("上课时间:"); sbCaption.Append(KCSJ.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(KCSJBegin.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("上课时间开始值:"); sbCaption.Append(KCSJBegin.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(KCSJEnd.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("上课时间结束值:"); sbCaption.Append(KCSJEnd.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(KSS.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("课时数:"); sbCaption.Append(KSS.Text); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(SKJS.SelectedValue)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("教师:"); sbCaption.Append(new RICH.Common.BM.T_PM_UserInfo.T_PM_UserInfoBusinessEntity().GetValueByFixCondition("UserID", SKJS.SelectedValue, "UserNickName")); sbCaption.Append(@"</div>"); } if (!DataValidateManager.ValidateIsNull(SKFJ.Text)) { sbCaption.Append(@"<div style=""margin-right:10px"">"); sbCaption.Append("教室:"); sbCaption.Append(SKFJ.Text); sbCaption.Append(@"</div>"); } // 一对一相关表 sbCaption.Append("</div>"); return(sbCaption.ToString()); }