/// <summary> /// Grid的双击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gdGrid_DoubleClick(object sender, EventArgs e) { //是否允许获取Grid数据 if (!IsAllowSetGridDataToCard()) { return; } if (_pickPartsDetailFunc != null) { var pickPartsResult = _pickPartsDetailFunc(SelectedGridList); if (!pickPartsResult) { //领取配件失败 MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0010, new object[] { MsgParam.PICK + MsgParam.AUTOPARTS }), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //领料成功,取消选中 var tempSelectedList = ListGridDS.Where(x => x.IsChecked).ToList(); foreach (var loopSelected in tempSelectedList) { loopSelected.IsChecked = false; } } this.DialogResult = DialogResult.OK; MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.I_0001, new object[] { MsgParam.PICK + MsgParam.AUTOPARTS }), MessageBoxButtons.OK, MessageBoxIcon.Information); }
/// <summary> /// 前端检查-保存 /// </summary> /// <returns></returns> private bool ClientCheckForSave() { //判断【配件类别名称】是否为空 if (string.IsNullOrEmpty(txtAPT_Name.Text)) { MessageBoxs.Show(Trans.BS, ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { SystemTableColumnEnums.BS_AutoPartsType.Name.APT_Name }), MessageBoxButtons.OK, MessageBoxIcon.Information); txtAPT_Name.Focus(); return(false); } //判断【顺序】是否超过超过9个 if (txtAPT_Index.Text.Length > 9) { //“顺序”字数不能超过9个 MessageBoxs.Show(Trans.BS, ToString(), MsgHelp.GetMsg(MsgCode.E_0029, new object[] { SystemTableColumnEnums.BS_AutoPartsType.Name.APT_Index, MsgParam.NINE }), MessageBoxButtons.OK, MessageBoxIcon.Information); txtAPT_Index.Focus(); return(false); } //检查配件类别是否存在 var userdCount = _bll.QueryForObject <int>(SQLID.BS_AutoPartsTypeManager_SQL02, new MDLBS_AutoPartsType { WHERE_APT_ID = txtAPT_ID.Text.Trim(), WHERE_APT_Name = txtAPT_Name.Text.Trim(), }); if (userdCount > 0) { //配件名称已存在 MessageBoxs.Show(Trans.BS, ToString(), MsgHelp.GetMsg(MsgCode.E_0006, new object[] { SystemTableColumnEnums.BS_AutoPartsName.Name.APN_Name }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } return(true); }
/// <summary> /// 删除汽修商 /// </summary> /// <param name="paramAutoFactoryCustomerList">待删除汽修商列表</param> /// <returns></returns> public bool DeleteAutoFactoryCustomer(List <MDLPIS_AutoFactoryCustomer> paramAutoFactoryCustomerList) { if (paramAutoFactoryCustomerList == null || paramAutoFactoryCustomerList.Count == 0) { ResultMsg = MsgHelp.GetMsg(MsgCode.W_0006, new object[] { SystemTableEnums.Name.PIS_AutoFactoryCustomer, SystemActionEnum.Name.DELETE }); return(false); } #region 带事务的删除 try { DBManager.BeginTransaction(DBCONFIG.Coeus); var deleteAutoFactoryCustomerResult = _bll.DeleteByList <MDLPIS_AutoFactoryCustomer, MDLPIS_AutoFactoryCustomer>(paramAutoFactoryCustomerList); if (!deleteAutoFactoryCustomerResult) { DBManager.RollBackTransaction(DBCONFIG.Coeus); ResultMsg = MsgHelp.GetMsg(MsgCode.E_0010, new object[] { SystemActionEnum.Name.DELETE, SystemTableEnums.Name.PIS_AutoFactoryCustomer }); return(false); } DBManager.CommitTransaction(DBCONFIG.Coeus); } catch (Exception ex) { DBManager.RollBackTransaction(DBCONFIG.Coeus); ResultMsg = MsgHelp.GetMsg(MsgCode.E_0018, new object[] { SystemActionEnum.Name.DELETE, ex.Message }); LogHelper.WriteBussLogEndNG(BussID, LoginInfoDAX.UserName, MethodBase.GetCurrentMethod().ToString(), ex.Message, "", null); return(false); } #endregion return(true); }
private string MergeResourceFiles(string inputPath) { StringBuilder stringBuilder = new(); if (Directory.Exists(inputPath)) { try { IEnumerable <string> srcfileList = Directory.EnumerateFiles(inputPath, "*.*", SearchOption.AllDirectories); if (!srcfileList.Any()) { throw new OpException(MsgHelp.FormatString(MsgHelp.ID.CMD_INVALID_FILE_OR_DIR, inputPath)); } foreach (string fileName in srcfileList) { stringBuilder.Append(string.Format("\n\n/*FILE: {0}*/\n\n", fileName)); stringBuilder.Append(File.ReadAllText(fileName)); } } catch (Exception) { throw new OpException(MsgHelp.FormatString(MsgHelp.ID.CMD_INVALID_FILE_OR_DIR, inputPath)); } } return(stringBuilder.ToString()); }
/// <summary> /// 新增 /// </summary> public override void NewAction() { #region 检查详情是否已保存 SetCardCtrlsToDetailDS(); base.NewUIModel = DetailDS; if (ViewHasChanged()) { //信息尚未保存,确定进行当前操作? DialogResult dialogResult = MessageBoxs.Show(Trans.BS, ToString(), MsgHelp.GetMsg(MsgCode.W_0001), MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dialogResult != DialogResult.OK) { return; } } #endregion //1.执行基类方法 base.NewAction(); //2.初始化【详情】Tab内控件 InitializeDetailTabControls(); //3.设置【详情】Tab为选中状态 tabControlFull.Tabs[SysConst.EN_DETAIL].Selected = true; SetCardCtrlsToDetailDS(); //将最新的值Copy到初始UIModel this.AcceptUIModelChanges(); }
public override void WriteResults(Result result, CLICommandOptions commandOptions, bool autoClose = true) { VerifyRulesResult verifyRulesResult = (VerifyRulesResult)result; //For console output, update write once for same results to console or file WriteOnce.TextWriter = TextWriter; if (string.IsNullOrEmpty(commandOptions.OutputFilePath)) { WriteOnce.Result("Results"); } if (verifyRulesResult.ResultCode != VerifyRulesResult.ExitCode.Verified) { WriteOnce.Any(MsgHelp.GetString(MsgHelp.ID.TAGTEST_RESULTS_FAIL), true, ConsoleColor.Red, WriteOnce.ConsoleVerbosity.Low); } else { WriteOnce.Any(MsgHelp.GetString(MsgHelp.ID.TAGTEST_RESULTS_SUCCESS), true, ConsoleColor.Green, WriteOnce.ConsoleVerbosity.Low); } if (verifyRulesResult.RuleStatusList.Count > 0) { WriteOnce.Result("Rule status"); foreach (RuleStatus ruleStatus in verifyRulesResult.RuleStatusList) { WriteOnce.General(String.Format("Ruleid: {0}, Rulename: {1}, Status: {2}", ruleStatus.RulesId, ruleStatus.RulesName, ruleStatus.Verified)); } } if (autoClose) { FlushAndClose(); } }
private static int VerifyOutputArgsRun(CLIPackRulesCmdOptions options) { Logger logger = Utils.SetupLogging(options, true); WriteOnce.Log = logger; options.Log = logger; if (options.RepackDefaultRules && !string.IsNullOrEmpty(options.OutputFilePath)) { WriteOnce.Info("output file argument ignored for -d option"); } options.OutputFilePath = options.RepackDefaultRules ? Utils.GetPath(Utils.AppPath.defaultRulesPackedFile) : options.OutputFilePath; if (string.IsNullOrEmpty(options.OutputFilePath)) { WriteOnce.Error(MsgHelp.GetString(MsgHelp.ID.PACK_MISSING_OUTPUT_ARG)); throw new OpException(MsgHelp.GetString(MsgHelp.ID.PACK_MISSING_OUTPUT_ARG)); } else { CommonOutputChecks(options); } return(RunPackRulesCommand(options)); }
public override void WriteResults(Result result, CLICommandOptions commandOptions, bool autoClose = true) { TagDiffResult tagDiffResult = (TagDiffResult)result; CLITagDiffCmdOptions cLITagDiffCmdOptions = (CLITagDiffCmdOptions)commandOptions; TextWriter.WriteLine(MsgHelp.FormatString(MsgHelp.ID.TAGTEST_RESULTS_TEST_TYPE, cLITagDiffCmdOptions.TestType)); if (tagDiffResult.ResultCode == TagDiffResult.ExitCode.TestFailed) { TextWriter.WriteLine(MsgHelp.GetString(MsgHelp.ID.TAGTEST_RESULTS_FAIL)); } else { TextWriter.WriteLine(MsgHelp.GetString(MsgHelp.ID.TAGTEST_RESULTS_SUCCESS)); } //Results list if (tagDiffResult.TagDiffList.Count > 0) { TextWriter.WriteLine("Differences"); foreach (TagDiff tagDiff in tagDiffResult.TagDiffList) { TextWriter.WriteLine(string.Format("Tag: {0}, Only found in file: {1}", tagDiff.Tag, tagDiff.Source)); } } if (autoClose) { FlushAndClose(); } }
public ActionResult Index(MsgHelp MsgHelp, EFPagingInfo <MsgHelp> p, int IsFirst = 0) { if (IsFirst == 0) { PageOfItems <MsgHelp> MsgHelpList1 = new PageOfItems <MsgHelp>(new List <MsgHelp>(), 0, 10, 0, new Hashtable()); ViewBag.MsgHelpList = MsgHelpList1; ViewBag.MsgHelp = MsgHelp; ViewBag.Add = this.checkPower("Add"); ViewBag.Edit = this.checkPower("Edit"); ViewBag.Delete = this.checkPower("Delete"); ViewBag.Save = this.checkPower("Save"); return(View()); } if (!MsgHelp.Name.IsNullOrEmpty()) { p.SqlWhere.Add(f => f.Name.Contains(MsgHelp.Name)); } if (!MsgHelp.State.IsNullOrEmpty()) { p.SqlWhere.Add(f => f.State == (MsgHelp.State == 99 ? 0 : MsgHelp.State)); } p.OrderByList.Add("Id", "DESC"); IPageOfItems <MsgHelp> MsgHelpList = Entity.Selects <MsgHelp>(p); ViewBag.MsgHelpList = MsgHelpList; ViewBag.MsgHelp = MsgHelp; ViewBag.Add = this.checkPower("Add"); ViewBag.Edit = this.checkPower("Edit"); ViewBag.Delete = this.checkPower("Delete"); ViewBag.Save = this.checkPower("Save"); return(View()); }
/// <summary> /// 删除配件类别 /// </summary> /// <param name="paramAutoPartsTypeList"></param> /// <returns></returns> public bool DeleteAutoPartsType(List <MDLBS_AutoPartsType> paramAutoPartsTypeList) { if (paramAutoPartsTypeList == null || paramAutoPartsTypeList.Count == 0) { //请选择要删除的配件类别 ResultMsg = MsgHelp.GetMsg(MsgCode.W_0006, new object[] { SystemActionEnum.Name.DELETE + SystemTableEnums.Name.BS_AutoPartsType }); return(false); } try { DBManager.BeginTransaction(DBCONFIG.Coeus); #region 除配件类别 var deleteAutoPartsTypeResult = _bll.DeleteByList <MDLBS_AutoPartsType, MDLBS_AutoPartsType>(paramAutoPartsTypeList); if (!deleteAutoPartsTypeResult) { DBManager.RollBackTransaction(DBCONFIG.Coeus); //删除[配件类别]信息失败 ResultMsg = MsgHelp.GetMsg(MsgCode.E_0010, new object[] { SystemActionEnum.Name.DELETE + SystemTableEnums.Name.BS_AutoPartsType }); return(false); } #endregion DBManager.CommitTransaction(DBCONFIG.Coeus); } catch (Exception ex) { DBManager.RollBackTransaction(DBCONFIG.Coeus); ResultMsg = MsgHelp.GetMsg(MsgCode.E_0018, new object[] { SystemActionEnum.Name.DELETE, ex.Message }); LogHelper.WriteBussLogEndNG(BussID, LoginInfoDAX.UserName, MethodBase.GetCurrentMethod().ToString(), ex.Message, "", null); return(false); } //刷新配件类别缓存 var resultAutoPartsTypeList = CacheDAX.Get(CacheDAX.ConfigDataKey.AutoPartsType) as List <MDLBS_AutoPartsType>; if (resultAutoPartsTypeList != null) { var newAutoPartsTypeList = resultAutoPartsTypeList; //待移除的类别名称 List <MDLBS_AutoPartsType> removeAutoPartsTypeList = new List <MDLBS_AutoPartsType>(); foreach (var loopAutoPartsType in newAutoPartsTypeList) { var deleteUser = paramAutoPartsTypeList.FirstOrDefault(x => x.APT_ID == loopAutoPartsType.APT_ID); if (deleteUser != null) { removeAutoPartsTypeList.Add(loopAutoPartsType); } } foreach (var loopAutoPartsType in removeAutoPartsTypeList) { newAutoPartsTypeList.Remove(loopAutoPartsType); } CacheDAX.Remove(CacheDAX.ConfigDataKey.AutoPartsType); CacheDAX.Add(CacheDAX.ConfigDataKey.AutoPartsType, newAutoPartsTypeList, true); } return(true); }
/// <summary> /// 删除供应商 /// </summary> /// <param name="paramSupplierList"></param> /// <returns></returns> public bool DeleteSupplier(List <MDLPIS_Supplier> paramSupplierList) { if (paramSupplierList == null || paramSupplierList.Count == 0) { //请选择要删除供应商 ResultMsg = MsgHelp.GetMsg(MsgCode.W_0006, new object[] { SystemTableEnums.Name.PIS_Supplier, SystemActionEnum.Name.DELETE }); return(false); } try { DBManager.BeginTransaction(DBCONFIG.Coeus); #region 除供应商 var deleteSupplierResult = _bll.DeleteByList <MDLPIS_Supplier, MDLPIS_Supplier>(paramSupplierList); if (!deleteSupplierResult) { DBManager.RollBackTransaction(DBCONFIG.Coeus); //删除[供应商]信息失败 ResultMsg = MsgHelp.GetMsg(MsgCode.E_0010, new object[] { SystemActionEnum.Name.DELETE + SystemTableEnums.Name.PIS_Supplier }); return(false); } #endregion DBManager.CommitTransaction(DBCONFIG.Coeus); } catch (Exception ex) { DBManager.RollBackTransaction(DBCONFIG.Coeus); ResultMsg = MsgHelp.GetMsg(MsgCode.E_0018, new object[] { SystemActionEnum.Name.DELETE, ex.Message }); LogHelper.WriteBussLogEndNG(BussID, LoginInfoDAX.UserName, MethodBase.GetCurrentMethod().ToString(), ex.Message, "", null); return(false); } //刷新供应商缓存 var resultSupplierList = CacheDAX.Get(CacheDAX.ConfigDataKey.AutoPartsSupplier) as List <MDLPIS_Supplier>; if (resultSupplierList != null) { var newSupplierList = resultSupplierList; //待移除的供应商 List <MDLPIS_Supplier> removeSupplierList = new List <MDLPIS_Supplier>(); foreach (var loopSupplier in newSupplierList) { var deleteSupplier = paramSupplierList.FirstOrDefault(x => x.SUPP_ID == loopSupplier.SUPP_ID); if (deleteSupplier != null) { removeSupplierList.Add(loopSupplier); } } foreach (var loopSupplier in removeSupplierList) { newSupplierList.Remove(loopSupplier); } CacheDAX.Remove(CacheDAX.ConfigDataKey.AutoPartsSupplier); CacheDAX.Add(CacheDAX.ConfigDataKey.AutoPartsSupplier, newSupplierList, true); } return(true); }
/// <summary> /// 前端检查-保存 /// </summary> /// <returns></returns> private bool ClientCheckForSave() { if (tabControlFull.Tabs[SysConst.EN_DETAIL].Selected) { //验证配件名称是否为空 if (string.IsNullOrEmpty(txtSI_Name.Text.Trim())) { //配件名称不能为空 MessageBoxs.Show(Trans.IS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { SystemTableColumnEnums.PIS_ShareInventory.Name.SI_Name }), MessageBoxButtons.OK, MessageBoxIcon.Information); txtSI_Name.Focus(); return(false); } } else { if (_detailGridDS.Count == 0) { //请至少添加一条共享库存信息 MessageBoxs.Show(Trans.IS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0014, new object[] { SystemTableEnums.Name.PIS_ShareInventory }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } } return(true); }
/// <summary> /// 充值 /// </summary> public override void RechargeAction() { //1.前端检查-充值 if (!ClientCheckForRecharge()) { return; } //2.将【详情】Tab内控件的值赋值给基类的DetailDS SetCardCtrlsToDetailDS(); //3.执行保存(含服务端检查) bool saveResult = _bll.SaveDetailDS(DetailDS, _depositDetailList); if (!saveResult) { //充值失败 MessageBoxs.Show(Trans.RIA, ToString(), _bll.ResultMsg, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //充值成功 MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.I_0001, new object[] { SystemActionEnum.Name.RECHARGE }), MessageBoxButtons.OK, MessageBoxIcon.Information); //初始化详情 InitializeDetailTabControls(); SetCardCtrlsToDetailDS(); //将最新的值Copy到初始UIModel this.AcceptUIModelChanges(); }
/// <summary> /// 确定并继续 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnConfirmAndContinue_Click(object sender, EventArgs e) { gdGrid.UpdateData(); if (_pickPartsDetailFunc != null) { var pickPartsResult = _pickPartsDetailFunc(SelectedGridList); if (!pickPartsResult) { //领取配件失败 MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0010, new object[] { MsgParam.PICK + MsgParam.AUTOPARTS }), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //领料成功,取消选中 var tempSelectedList = ListGridDS.Where(x => x.IsChecked).ToList(); foreach (var loopSelected in tempSelectedList) { loopSelected.IsChecked = false; } gdGrid.Refresh(); } if (SelectedGridList.Count == 0) { //请至少勾选一条数据 MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0038, new object[] { }), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
/// <summary> /// 保存 /// </summary> public override void SaveAction() { //1.前端检查 if (!ClientCheck()) { return; } //保存数据 bool saveResult = _bll.SaveUserMenu(mcbUserName.SelectedValue, _userMenuAuthoritiyList, _userActionAuthoritiyList, _userJobAuthoritiyList); if (!saveResult) { //保存失败 MessageBoxs.Show(Trans.SM, this.ToString(), _bll.ResultMsg, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //保存成功 MessageBoxs.Show(Trans.SM, this.ToString(), MsgHelp.GetMsg(MsgCode.I_0001, new object[] { SystemActionEnum.Name.SAVE }), MessageBoxButtons.OK, MessageBoxIcon.Information); _userMenuAuthoritiyList.StartMonitChanges(); _userActionAuthoritiyList.StartMonitChanges(); _userJobAuthoritiyList.StartMonitChanges(); //获取最新的用户菜单明细授权和用户菜单明细动作授权进行绑定 SetUserMenuAndActionInfo(); //获取最新的用户作业授权进行绑定 SetUserJobInfo(); }
/// <summary> /// 删除码表 /// </summary> /// <param name="paramCodeTableList">待删除的码表List</param> /// <returns></returns> public bool DeleteCodeTable(List <MDLSM_CodeTable> paramCodeTableList) { try { DBManager.BeginTransaction(DBCONFIG.Coeus); var deleteCodeTableResult = _bll.DeleteByList <MDLSM_CodeTable, MDLSM_CodeTable>(paramCodeTableList); if (!deleteCodeTableResult) { DBManager.RollBackTransaction(DBCONFIG.Coeus); ResultMsg = MsgHelp.GetMsg(MsgCode.E_0010, new object[] { SystemActionEnum.Name.DELETE, SystemTableEnums.Name.SM_CodeTable }); return(false); } DBManager.CommitTransaction(DBCONFIG.Coeus); } catch (Exception ex) { DBManager.RollBackTransaction(DBCONFIG.Coeus); ResultMsg = MsgHelp.GetMsg(MsgCode.E_0018, new object[] { SystemActionEnum.Name.DELETE, ex.Message }); LogHelper.WriteBussLogEndNG(BussID, LoginInfoDAX.UserName, MethodBase.GetCurrentMethod().ToString(), ex.Message, "", null); return(false); } return(true); }
/// <summary> /// Only AnalyzeResultsWriter supports an html option /// </summary> /// <param name="options"></param> /// <returns></returns> private static CommandResultsWriter GetAnalyzeWriter(CLIAnalyzeCmdOptions options) { CommandResultsWriter?writer; switch (options.OutputFileFormat.ToLower()) { case "json": writer = new AnalyzeJsonWriter(); break; case "text": writer = new AnalyzeTextWriter(options.TextOutputFormat); break; case "html": writer = new AnalyzeHtmlWriter(); break; case "sarif": writer = new AnalyzeSarifWriter(); break; default: WriteOnce.Error(MsgHelp.FormatString(MsgHelp.ID.CMD_INVALID_ARG_VALUE, "-f")); throw new OpException((MsgHelp.FormatString(MsgHelp.ID.CMD_INVALID_ARG_VALUE, "-f"))); } //assign the stream as a file or console writer.OutputFileName = options.OutputFilePath; writer.TextWriter = GetTextWriter(writer.OutputFileName); return(writer); }
/// <summary> /// 添加前检查 /// </summary> private bool CheckForAdd() { //第三方编码 string thirdNo = txtVBPI_ThirdNo.Text.Trim(); //配件名称 string autoPartsName = mcbVTPI_AutoPartsName.SelectedValue; //配件品牌 string autoPartsBrand = txtVBPI_AutoPartsBrand.Text.Trim(); if (string.IsNullOrEmpty(thirdNo)) { MessageBoxs.Show(Trans.BS, ToString(), MsgHelp.GetMsg(MsgCode.E_0000, "请输入第三方编码"), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } if (string.IsNullOrEmpty(autoPartsName)) { MessageBoxs.Show(Trans.BS, ToString(), MsgHelp.GetMsg(MsgCode.E_0000, "请选择配件名称"), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } if (string.IsNullOrEmpty(autoPartsBrand)) { MessageBoxs.Show(Trans.BS, ToString(), MsgHelp.GetMsg(MsgCode.E_0000, "请选择配件品牌"), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } _brandPartsInfo.VTPI_ThirdNo = thirdNo; _brandPartsInfo.VTPI_AutoPartsName = autoPartsName; _brandPartsInfo.VTPI_AutoPartsBrand = autoPartsBrand; _brandPartsInfo.VTPI_Remark = txtVBPI_Remark.Text.Trim(); return(true); }
/// <summary> /// 仓位查询 /// </summary> /// <param name="paramSelectedValuePropertyName">选中项的值对应数据源中的属性名</param> /// <param name="paramSelectedTextPropertyName">选中项的描述对应数据源中的属性名</param> /// <param name="paramSelectedValue">默认选中项的值</param> /// <param name="paramCustomeSelectionMode">选择模式,默认单选</param> /// <param name="paramItemSelectedItemParentValue">默认选中项的父级值</param> public FrmWarehouseBinQuery(string paramSelectedValuePropertyName, string paramSelectedTextPropertyName = null, string paramSelectedValue = null, CustomEnums.CustomeSelectionMode paramCustomeSelectionMode = CustomEnums.CustomeSelectionMode.Single, string paramItemSelectedItemParentValue = null) { if (string.IsNullOrEmpty(paramSelectedValuePropertyName)) { MessageBoxs.Show(Trans.COM, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0021, new object[] { MsgParam.paramSelectedValuePropertyName }), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } SelectedValuePropertyName = paramSelectedValuePropertyName; SelectedValue = paramSelectedValue; //paramSelectedTextPropertyName为空时,用paramSelectedValuePropertyName代替 if (string.IsNullOrEmpty(paramSelectedTextPropertyName)) { SelectedTextPropertyName = paramSelectedValuePropertyName; SelectedText = paramSelectedValue; } else { SelectedTextPropertyName = paramSelectedTextPropertyName; } ListSelectionMode = paramCustomeSelectionMode; SelectedItemParentValue = paramItemSelectedItemParentValue; InitializeComponent(); }
/// <summary> /// 反审核 /// </summary> /// <param name="paramHead">单头</param> /// <returns></returns> public bool UnApproveDetailDS(SalesTemplateManagerUIModel paramHead) { if (paramHead == null) { ResultMsg = MsgHelp.GetMsg(MsgCode.W_0024, new object[] { SystemTableEnums.Name.SD_SalesTemplate, SystemActionEnum.Name.UNAPPROVE }); return(false); } MDLSD_SalesTemplate argsSalesTemplate = new MDLSD_SalesTemplate(); CopyModel(paramHead, argsSalesTemplate); argsSalesTemplate.WHERE_SasT_ID = argsSalesTemplate.SasT_ID; argsSalesTemplate.WHERE_SasT_VersionNo = argsSalesTemplate.SasT_VersionNo; argsSalesTemplate.SasT_VersionNo++; argsSalesTemplate.SasT_ApprovalStatusCode = ApprovalStatusEnum.Code.DSH; argsSalesTemplate.SasT_ApprovalStatusName = ApprovalStatusEnum.Name.DSH; argsSalesTemplate.SasT_UpdatedBy = LoginInfoDAX.UserName; argsSalesTemplate.SasT_UpdatedTime = BLLCom.GetCurStdDatetime(); bool saveSalesTemplate = _bll.Save <MDLSD_SalesTemplate>(argsSalesTemplate); //将最新数据回写给DetailDS CopyModel(argsSalesTemplate, paramHead); return(saveSalesTemplate); }
private static int VerifyOutputArgsRun(CLIAnalyzeCmdOptions options) { Logger logger = Utils.SetupLogging(options, true); WriteOnce.Log = logger; options.Log = logger; //analyze with html format limit checks if (options.OutputFileFormat == "html") { options.OutputFilePath = options.OutputFilePath ?? "output.html"; string extensionCheck = Path.GetExtension(options.OutputFilePath); if (extensionCheck != ".html" && extensionCheck != ".htm") { WriteOnce.Info(MsgHelp.GetString(MsgHelp.ID.ANALYZE_HTML_EXTENSION)); } if (options.AllowDupTags) //fix #183; duplicates results for html format is not supported which causes filedialog issues { WriteOnce.Error(MsgHelp.GetString(MsgHelp.ID.ANALYZE_NODUPLICATES_HTML_FORMAT)); throw new OpException(MsgHelp.GetString(MsgHelp.ID.ANALYZE_NODUPLICATES_HTML_FORMAT)); } if (options.SimpleTagsOnly) //won't work for html that expects full data for UI { WriteOnce.Error(MsgHelp.GetString(MsgHelp.ID.ANALYZE_SIMPLETAGS_HTML_FORMAT)); throw new Exception(MsgHelp.GetString(MsgHelp.ID.ANALYZE_SIMPLETAGS_HTML_FORMAT)); } } CommonOutputChecks((CLICommandOptions)options); return(RunAnalyzeCommand(options)); }
/// <summary> /// 服务端检查 /// </summary> /// <param name="paramHead">UIModel</param> /// <returns></returns> private bool ServerCheck(SalesTemplateManagerUIModel paramHead) { if (paramHead == null) { //没有获取到销售模板,保存失败 ResultMsg = MsgHelp.GetMsg(MsgCode.W_0024, new object[] { SystemTableEnums.Name.SD_SalesTemplate, SystemActionEnum.Name.SAVE }); return(false); } #region 判断是否存在相同名称的销售模板 int resultCount = _bll.QueryForObject <int>(SQLID.SD_SalesTemplate_SQL01, new MDLSD_SalesTemplate { WHERE_SasT_ID = paramHead.SasT_ID, WHERE_SasT_Org_ID = paramHead.SasT_Org_ID, WHERE_SasT_Name = paramHead.SasT_Name, }); if (resultCount > 0) { ResultMsg = MsgHelp.GetMsg(MsgCode.E_0006, new object[] { MsgParam.SAME + MsgParam.OF + SystemTableColumnEnums.SD_SalesTemplate.Name.SasT_Name }); return(false); } return(true); #endregion }
/// <summary> /// 初始化系统消息 /// </summary> public static void InitializeSystemMessage() { LogHelper.WriteBussLogStart(Trans.COM, LoginInfoDAX.UserName, MethodBase.GetCurrentMethod().ToString(), string.Empty, string.Empty, null); //定义枚举对象列表 List <MDLSM_Message> msgList = new List <MDLSM_Message>(); //查询系统所有枚举数据 baseDAX.QueryForList <MDLSM_Message>(new MDLSM_Message(), msgList); foreach (var loopMsg in msgList) { if (loopMsg == null || string.IsNullOrEmpty(loopMsg.Msg_ID) || string.IsNullOrEmpty(loopMsg.Msg_Content)) { continue; } if (loopMsg.Msg_Content.Contains("\\r\\n")) { loopMsg.Msg_Content = loopMsg.Msg_Content.Replace("\\r\\n", "\r\n"); } } //初始化系统消息 MsgHelp.InitializeMsg(msgList); LogHelper.WriteBussLogEndOK(Trans.COM, LoginInfoDAX.UserName, MethodBase.GetCurrentMethod().ToString(), string.Empty, string.Empty, null); }
/// <summary> /// 删除 /// </summary> public override void DeleteAction() { //1.前端检查-删除 if (!ClientCheckForDelete()) { return; } var argsDetail = new List <MDLPIS_PurchaseForecastOrderDetail>(); //将HeadDS转换为TBModel对象 var argsHead = base.HeadDS.ToTBModelForSaveAndDelete <MDLPIS_PurchaseForecastOrder>(); //将当前DetailGridDS转换为指定类型的TBModelList _detailGridDS.ToTBModelListForUpdateAndDelete <MDLPIS_PurchaseForecastOrderDetail>(argsDetail); //过滤明细列表中未保存的数据 argsDetail = argsDetail.Where(x => !string.IsNullOrEmpty(x.WHERE_PFOD_ID)).ToList(); //2.执行删除 if (!_bll.UnityDelete <MDLPIS_PurchaseForecastOrder, MDLPIS_PurchaseForecastOrderDetail>(argsHead, argsDetail)) { MessageBoxs.Show(Trans.PIS, this.ToString(), _bll.ResultMsg, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } MessageBoxs.Show(Trans.PIS, this.ToString(), MsgHelp.GetMsg(MsgCode.I_0001, new object[] { SystemActionEnum.Name.DELETE }), MessageBoxButtons.OK, MessageBoxIcon.Information); //3.清空【详情】画面数据 InitializeDetailTabControls(); //4.执行查询 QueryAction(); }
/// <summary> /// 保存 /// </summary> public override void SaveAction() { //1.前端检查-保存 if (!ClientCheckForSave()) { return; } //2.将【详情】Tab内控件的值赋值给基类的DetailDS SetCardCtrlsToDetailDS(); //3.执行保存(含服务端检查) if (!_bll.SaveDetailDS(DetailDS)) { MessageBoxs.Show(Trans.BS, ToString(), _bll.ResultMsg, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //保存成功 MessageBoxs.Show(Trans.SM, ToString(), MsgHelp.GetMsg(MsgCode.I_0001, new object[] { SystemActionEnum.Name.SAVE }), MessageBoxButtons.OK, MessageBoxIcon.Information); //刷新列表 RefreshList(); //4.将DetailDS数据赋值给【详情】Tab内的对应控件 SetDetailDSToCardCtrls(); //将最新的值Copy到初始UIModel this.AcceptUIModelChanges(); }
private static int VerifyOutputArgsRun(CLIAnalyzeCmdOptions options) { Logger logger = Utils.SetupLogging(options, true); WriteOnce.Log = logger; options.Log = logger; //analyze with html format limit checks if (options.OutputFileFormat == "html") { if (!string.IsNullOrEmpty(options.OutputFilePath)) //dependent local files won't be there; TODO look into dir copy to target! { WriteOnce.Info("-o output file argument ignored for html format"); } options.OutputFilePath = "output.html"; if (options.AllowDupTags) //fix #183; duplicates results for html format is not supported which causes filedialog issues { WriteOnce.Error(MsgHelp.GetString(MsgHelp.ID.ANALYZE_NODUPLICATES_HTML_FORMAT)); throw new OpException(MsgHelp.GetString(MsgHelp.ID.ANALYZE_NODUPLICATES_HTML_FORMAT)); } if (options.SimpleTagsOnly) //won't work for html that expects full data for UI { WriteOnce.Error(MsgHelp.GetString(MsgHelp.ID.ANALYZE_SIMPLETAGS_HTML_FORMAT)); throw new Exception(MsgHelp.GetString(MsgHelp.ID.ANALYZE_SIMPLETAGS_HTML_FORMAT)); } } CommonOutputChecks((CLICommandOptions)options); return(RunAnalyzeCommand(options)); }
/// <summary> /// 删除系统作业 /// </summary> /// <param name="paramBatchJobList">待删除的系统作业List</param> /// <returns></returns> public bool DeleteBatchJob(List <MDLCSM_BatchJob> paramBatchJobList) { var funcName = "SaveDetailDS"; LogHelper.WriteBussLogStart(BussID, LoginInfoDAX.UserName, funcName, "", "", null); try { DBManager.BeginTransaction(DBCONFIG.Coeus); var deleteBatchJobResult = _bll.DeleteByList <MDLCSM_BatchJob, MDLCSM_BatchJob>(paramBatchJobList); if (!deleteBatchJobResult) { DBManager.RollBackTransaction(DBCONFIG.Coeus); ResultMsg = MsgHelp.GetMsg(MsgCode.E_0010, new object[] { SystemActionEnum.Name.DELETE, SystemTableEnums.Name.CSM_BatchJob }); LogHelper.WriteBussLogEndNG(BussID, LoginInfoDAX.UserName, funcName, ResultMsg, "", null); return(false); } DBManager.CommitTransaction(DBCONFIG.Coeus); } catch (Exception ex) { DBManager.RollBackTransaction(DBCONFIG.Coeus); ResultMsg = MsgHelp.GetMsg(MsgCode.E_0018, new object[] { SystemActionEnum.Name.DELETE, ex.Message }); LogHelper.WriteBussLogEndNG(BussID, LoginInfoDAX.UserName, funcName, ex.Message, "", null); return(false); } return(true); }
/// <summary> /// 前端检查-保存 /// </summary> /// <returns></returns> private bool ClientCheckForSave() { if (!string.IsNullOrEmpty(txtGC_ID.Text.Trim())) { //验证普通客户是否已被使用 StringBuilder customerIDs = new StringBuilder(); customerIDs.Append(SysConst.Semicolon_DBC + txtGC_ID.Text + SysConst.Semicolon_DBC); //查询普通客户是否被引用过 List <MDLPIS_GeneralCustomer> generalCustomerList = new List <MDLPIS_GeneralCustomer>(); _bll.QueryForList(SQLID.PIS_GeneralCustomerManager_SQL02, new MDLPIS_GeneralCustomer { WHERE_GC_ID = customerIDs.ToString() }, generalCustomerList); if (generalCustomerList.Count > 0) { MessageBoxs.Show(Trans.PIS, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0007, new object[] { SystemTableEnums.Name.PIS_GeneralCustomer, MsgParam.APPLY, SystemActionEnum.Name.SAVE }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } } //验证姓名 if (string.IsNullOrEmpty(txtGC_Name.Text)) { MessageBoxs.Show(Trans.PIS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { SystemTableColumnEnums.PIS_GeneralCustomer.Name.GC_Name }), MessageBoxButtons.OK, MessageBoxIcon.Information); txtGC_Name.Focus(); return(false); } //验证手机号码 if (string.IsNullOrEmpty(txtGC_PhoneNo.Text)) { MessageBoxs.Show(Trans.PIS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { SystemTableColumnEnums.PIS_GeneralCustomer.Name.GC_PhoneNo }), MessageBoxButtons.OK, MessageBoxIcon.Information); txtGC_PhoneNo.Focus(); return(false); } return(true); }
public static CommandResultsWriter GetExportWriter(CLIExportTagsCmdOptions options) { CommandResultsWriter?writer; switch (options.OutputFileFormat.ToLower()) { case "_dummy": writer = new ExportDummyWriter(); break; case "json": writer = new JsonWriter(); break; case "text": writer = new ExportTextWriter(); break; default: WriteOnce.Error(MsgHelp.FormatString(MsgHelp.ID.CMD_INVALID_ARG_VALUE, "-f")); throw new OpException((MsgHelp.FormatString(MsgHelp.ID.CMD_INVALID_ARG_VALUE, "-f"))); } //assign the stream as a file or console writer.OutputFileName = options.OutputFilePath; writer.TextWriter = GetTextWriter(writer.OutputFileName); return(writer); }
/// <summary> /// 保存 /// </summary> public override void SaveAction() { //1.前端检查-保存 if (!ClientCheckForSave()) { return; } //2.将【详情】Tab内控件的值赋值给基类的DetailDS SetCardCtrlsToDetailDS(); gdGridWarehouseBin.UpdateData(); //3.执行保存(含服务端检查) bool saveResult = _bll.SaveDetailDS(HeadDS, _warehouseBinList); if (!saveResult) { //保存失败 MessageBoxs.Show(Trans.PIS, this.ToString(), _bll.ResultMsg, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //保存成功 MessageBoxs.Show(Trans.PIS, this.ToString(), MsgHelp.GetMsg(MsgCode.I_0001, new object[] { SystemActionEnum.Name.SAVE }), MessageBoxButtons.OK, MessageBoxIcon.Information); //刷新列表 RefreshList(); //设置详情是否可编辑 SetDetailControl(); _warehouseBinList.StartMonitChanges(); //4.将DetailDS数据赋值给【详情】Tab内的对应控件 SetDetailDSToCardCtrls(); //将最新的值Copy到初始UIModel this.AcceptUIModelChanges(); }