/// <summary> /// 前端检查-保存 /// </summary> /// <returns></returns> private bool ClientCheckForSave() { //验证品牌 if (string.IsNullOrEmpty(mcbVBIS_Brand.SelectedValue)) { MessageBoxs.Show(Trans.BS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { SystemTableColumnEnums.BS_VehicleBrandInspireSumma.Name.VBIS_Brand }), MessageBoxButtons.OK, MessageBoxIcon.Information); mcbVBIS_Brand.Focus(); return(false); } //验证车系 if (string.IsNullOrEmpty(mcbVBIS_Inspire.SelectedValue)) { MessageBoxs.Show(Trans.BS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { SystemTableColumnEnums.BS_VehicleBrandInspireSumma.Name.VBIS_Inspire }), MessageBoxButtons.OK, MessageBoxIcon.Information); mcbVBIS_Inspire.Focus(); return(false); } //验证车型描述 if (string.IsNullOrEmpty(txtVBIS_ModelDesc.Text.Trim())) { MessageBoxs.Show(Trans.BS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { SystemTableColumnEnums.BS_VehicleBrandInspireSumma.Name.VBIS_ModelDesc }), MessageBoxButtons.OK, MessageBoxIcon.Information); txtVBIS_ModelDesc.Focus(); return(false); } return(true); }
/// <summary> /// 确定按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnConfirm_Click(object sender, EventArgs e) { //前端检查-保存 if (!ClientCheckForSave()) { return; } foreach (var loopItem in ListGridDS) { loopItem.BusinessOrgID = txtBusinessOrgID.Text; loopItem.BusinessOrgName = txtBusinessOrgName.Text; loopItem.ReceiveObjectTypeName = cbReceivableObjectTypeName.Text; loopItem.ReceiveObjectTypeCode = cbReceivableObjectTypeName.Value?.ToString(); loopItem.ReceiveObjectID = txtRecObjectID.Text; loopItem.ReceiveObjectName = txtRecObjectName.Text; } //将页面内控件的值赋值给基类的_payBillManager SetCardCtrlsToDetailDS(); if (!_bll.SavePurchaseOrderToPayConfirmData(_payBillManager, ListGridDS, _accountPayableList)) { //保存失败 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); this.DialogResult = DialogResult.OK; }
/// <summary> /// 充值 /// </summary> public override void WalletDepositMoney() { if (string.IsNullOrEmpty(txtWal_No.Text)) { //钱包账号为空,充值失败 MessageBoxs.Show(Trans.SD, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0016, new object[] { SystemTableColumnEnums.EWM_Wallet.Name.Wal_No, SystemActionEnum.Name.RECHARGE }), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //待充值的钱包 WalletInfoUIModel walletToDeposit = BLLCom.GetWalletByWalletNo(txtWal_No.Text); if (string.IsNullOrEmpty(walletToDeposit.Wal_ID) || string.IsNullOrEmpty(walletToDeposit.Wal_No)) { //没有获取到钱包,充值失败 MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.W_0024, new object[] { MsgParam.WALLET, SystemActionEnum.Name.RECHARGE }), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Dictionary <string, object> paramViewParameters = new Dictionary <string, object> { //钱包相关信息 { RIAViewParamKey.WalletInfo.ToString(), walletToDeposit }, }; //跳转到[钱包充值] SystemFunction.ShowViewFromView(MsgParam.WALLET_DEPOSITMONEY, ViewClassFullNameConst.RIA_FrmWalletDepositMoney, true, PageDisplayMode.TabPage, paramViewParameters, null); }
/// <summary> /// 保存 /// </summary> public override void SaveAction() { //1.前端检查-保存 if (!ClientCheckForSave()) { return; } //2.将【详情】Tab内控件的值赋值给基类的DetailDS SetCardCtrlsToDetailDS(); //3.执行保存(含服务端检查) bool saveResult = _bll.SaveDetailDS(DetailDS); if (!saveResult) { //保存失败 MessageBoxs.Show(Trans.RIA, this.ToString(), _bll.ResultMsg, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //保存成功 MessageBoxs.Show(Trans.RIA, this.ToString(), MsgHelp.GetMsg(MsgCode.I_0001, new object[] { SystemActionEnum.Name.SAVE }), MessageBoxButtons.OK, MessageBoxIcon.Information); //将DetailDS数据赋值给【详情】Tab内的对应控件 SetDetailDSToCardCtrls(); //将最新的值Copy到初始UIModel this.AcceptUIModelChanges(); //设置详情页面控件的是否可编辑 SetDetailControl(); }
/// <summary> /// 新增 /// </summary> public override void NewAction() { #region 检查详情是否已保存 SetCardCtrlsToDetailDS(); base.NewUIModel = DetailDS; if (ViewHasChanged()) { //信息尚未保存,确定进行当前操作? DialogResult dialogResult = MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.W_0001), MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dialogResult != DialogResult.OK) { return; } } #endregion //1.执行基类方法 base.NewAction(); //2.初始化【详情】Tab内控件 InitializeDetailTabControls(); //设置详情页面控件的是否可编辑 SetDetailControl(); SetCardCtrlsToDetailDS(); //将最新的值Copy到初始UIModel this.AcceptUIModelChanges(); }
/// <summary> /// 前端检查-保存 /// </summary> private bool ClientCheckForSave() { #region 验证 if (string.IsNullOrEmpty(numThisPayAmount.Text.Trim())) { MessageBoxs.Show(Trans.FM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { MsgParam.THIS_PAYAMOUNT }), MessageBoxButtons.OK, MessageBoxIcon.Information); numThisPayAmount.Focus(); return(false); } decimal payAmount = Convert.ToDecimal(numThisPayAmount.Value ?? 0); decimal unPayAmount = Convert.ToDecimal(txtAPB_UnpaidAmount.Text.Trim() == "" ? "0" : txtAPB_UnpaidAmount.Text.Trim()); if (payAmount > unPayAmount) { //本次付款金额大于未付金额,是否确认支付?\r\n单击【确定】支付单据,【取消】返回。 DialogResult isPay = MessageBoxs.Show(Trans.FM, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0037, new object[] { MsgParam.THIS_PAYAMOUNT, SystemTableColumnEnums.FM_AccountPayableBill.Name.APB_UnpaidAmount, MsgParam.PAY }), MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (isPay != DialogResult.OK) { return(false); } } #endregion return(true); }
/// <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> /// <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> 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> 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(); }
/// <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); }
/// <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 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(); }
/// <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> 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(); }
/// <summary> /// 页面加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmViewAndPrintAccountReceivableBill_Load(object sender, EventArgs e) { if (ViewParameters != null) { if (ViewParameters.ContainsKey(FMViewParamKey.AccountReceivableBill.ToString())) { _accountReceivableBill = ViewParameters[FMViewParamKey.AccountReceivableBill.ToString()] as AccountReceivableBillUIModelToPrint; //加载RLDC相关信息 if (_accountReceivableBill == null) { MessageBoxs.Show(Trans.FM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0013, SystemTableEnums.Name.FM_AccountReceivableBill), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } else { MessageBox.Show(@"请传入参数ViewParameters"); return; } ExecutePrintA4Size(); }
private void btnSure_Click(object sender, EventArgs e) { try { if (txtOriginalPassword.Text.Trim() == string.Empty) { MessageBoxs.Show(Trans.COM, this.ToString(), "原密码不可为空", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!LoginInfoDAX.UserPassword.Equals(CryptoHelp.EncodeToMD5(txtOriginalPassword.Text.Trim()))) { MessageBoxs.Show(Trans.COM, this.ToString(), "原密码错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (txtNewPassword.Text.Trim() == string.Empty) { MessageBoxs.Show(Trans.COM, this.ToString(), "新密码不可为空", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (txtNewPassword.Text.Trim() != txtSurePassword.Text.Trim()) { MessageBoxs.Show(Trans.COM, this.ToString(), "新密码和确认密码不一致", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } DialogResult dr = MessageBoxs.Show(Trans.COM, this.ToString(), "您将要修改密码!\r\n单击【确定】继续,【取消】返回。", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dr != DialogResult.OK) { return; } MDLSM_User userQuery = new MDLSM_User(); userQuery.WHERE_User_ID = LoginInfoDAX.UserID; MDLSM_User userResult = new MDLSM_User(); _bll.QueryForObject <MDLSM_User, MDLSM_User>(userQuery, userResult); userResult.WHERE_User_ID = LoginInfoDAX.UserID; userResult.WHERE_User_VersionNo = userResult.User_VersionNo; userResult.User_Password = CryptoHelp.EncodeToMD5(txtNewPassword.Text.Trim()); userResult.User_VersionNo += 1; bool boolTmp = _bll.Save <MDLSM_User>(userResult); if (!boolTmp) { MessageBoxs.Show(Trans.COM, this.ToString(), "保存失败!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { MessageBoxs.Show(Trans.COM, this.ToString(), "保存成功!", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); _supplierMain.DialogResult = DialogResult.Yes; _supplierMain.Close(); _flg.Show(); } } catch (Exception ex) { MessageBoxs.Show(Trans.COM, this.ToString(), ex.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error); LogHelper.WriteErrorLog(Trans.COM, System.Reflection.MethodBase.GetCurrentMethod().ToString() + SysConst.ENTER + ex.StackTrace, ex.Message, null, ex); } }
/// <summary> /// 将Grid中选中的数据赋值给【详情】Tab内的对应控件 /// </summary> private void SetGridDataToCardCtrls() { //判断是否允许将【列表】Grid数据设置到【详情】Tab内的对应控件 if (!IsAllowSetGridDataToCard()) { return; } SetCardCtrlsToDetailDS(); base.NewUIModel = DetailDS; var activeRowIndex = gdGrid.ActiveRow.Index; //判断Grid内[唯一标识]是否为空 if (gdGrid.Rows[activeRowIndex].Cells[SystemTableColumnEnums.BS_AutoPartsType.Code.APT_ID].Value == null || string.IsNullOrEmpty(gdGrid.Rows[activeRowIndex].Cells[SystemTableColumnEnums.BS_AutoPartsType.Code.APT_ID].Value.ToString())) { return; } //将选中的Grid行对应数据Model赋值给[DetailDS] //******************************************************************************** //**********************************【重要说明】********************************** //*****此处和上面的条件判断必须用GridDS内能唯一标识一条记录的字段作为过滤条件***** //******************************************************************************** DetailDS = base.GridDS.FirstOrDefault(x => x.APT_ID == gdGrid.Rows[activeRowIndex].Cells[SystemTableColumnEnums.BS_AutoPartsType.Code.APT_ID].Value); if (DetailDS == null || string.IsNullOrEmpty(DetailDS.APT_ID)) { return; } if (txtAPT_ID.Text != DetailDS.APT_ID || (txtAPT_ID.Text == DetailDS.APT_ID && txtAPT_VersionNo.Text != DetailDS.APT_VersionNo?.ToString())) { if (txtAPT_ID.Text == DetailDS.APT_ID && txtAPT_VersionNo.Text != DetailDS.APT_VersionNo?.ToString()) { //数据版本已过期,将加载最新详情。 MessageBoxs.Show(Trans.BS, ToString(), MsgHelp.GetMsg(MsgCode.I_0000, new object[] { MsgParam.DataHasOverdue }), MessageBoxButtons.OKCancel, MessageBoxIcon.Information); } else if (ViewHasChanged()) { //将放弃之前的修改,是否继续? DialogResult dialogResult = MessageBoxs.Show(Trans.BS, ToString(), MsgHelp.GetMsg(MsgCode.I_0000, new object[] { MsgParam.ConfirmGiveUpEdit }), MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dialogResult != DialogResult.OK) { //选中【详情】Tab tabControlFull.Tabs[SysConst.EN_DETAIL].Selected = true; return; } } //将DetailDS数据赋值给【详情】Tab内的对应控件 SetDetailDSToCardCtrls(); } //选中【详情】Tab tabControlFull.Tabs[SysConst.EN_DETAIL].Selected = true; //将最新的值Copy到初始UIModel this.AcceptUIModelChanges(); }
/// <summary> /// 确定按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnConfirm_Click(object sender, EventArgs e) { #region 验证 for (int i = 0; i < gdReturnStockInDetail.Rows.Count; i++) { //验证入库数量 if (!BLLCom.IsDecimal(gdReturnStockInDetail.Rows[i].Cells[SystemTableColumnEnums.PIS_StockInDetail.Code.SID_Qty].Text.Trim())) { MessageBoxs.Show(Trans.SD, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0024, new object[] { i + 1, SystemTableColumnEnums.PIS_StockInDetail.Name.SID_Qty, MsgParam.POSITIVE_INTEGER }), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //计算入库金额:入库金额 = 入库数量 * 入库单价 gdReturnStockInDetail.Rows[i].Cells[SystemTableColumnEnums.PIS_StockInDetail.Code.SID_Amount].Value = Convert.ToDecimal(gdReturnStockInDetail.Rows[i].Cells[SystemTableColumnEnums.PIS_StockInDetail.Code.SID_Qty].Value) * Convert.ToDecimal(gdReturnStockInDetail.Rows[i].Cells[SystemTableColumnEnums.PIS_StockInDetail.Code.SID_UnitCostPrice].Value); } //[退货明细]列表中配件的拒收数量要与[退货入库明细]列表中对应配件的入库总数量一致 foreach (var loopSalesOrderReturnDetail in SalesOrderReturnDetailList) { var tempStockInDetailList = ReturnStockInDetailList.Where(x => x.SID_Barcode == loopSalesOrderReturnDetail.SOD_Barcode).ToList(); //退货入库明细中该配件的入库总数量 decimal barcodeStockInTotalQty = 0; foreach (var loopStockInDetail in tempStockInDetailList) { barcodeStockInTotalQty += (loopStockInDetail.SID_Qty ?? 0); } //退货明细中该配件的退货总数量 decimal barcodeReturnTotalQty = 0; if (_confirmReturnSourType == SDViewParamValue.ConfirmReturnSourType.VerifySalesOrder) { barcodeReturnTotalQty = loopSalesOrderReturnDetail.SOD_RejectQty ?? 0; } else if (_confirmReturnSourType == SDViewParamValue.ConfirmReturnSourType.ApproveReturnSalesOrder) { barcodeReturnTotalQty = loopSalesOrderReturnDetail.SOD_Qty ?? 0; } if (barcodeStockInTotalQty < barcodeReturnTotalQty) { //配件:loopSalesOrderReturnDetail.SOD_Name入库数量的总和小于退货数量,请调整入库数量! MessageBoxs.Show(Trans.SD, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0000, new object[] { "配件:" + loopSalesOrderReturnDetail.SOD_Name + "入库数量的总和小于退货数量,请调整入库数量!" }), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (barcodeStockInTotalQty > barcodeReturnTotalQty) { //配件:loopSalesOrderReturnDetail.SOD_Name入库数量的总和大于退货数量,请调整入库数量! MessageBoxs.Show(Trans.SD, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0000, new object[] { "配件:" + loopSalesOrderReturnDetail.SOD_Name + "入库数量的总和大于退货数量,请调整入库数量!" }), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } #endregion DialogResult = DialogResult.OK; }
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) { string exSource = e.Exception != null ? e.Exception.Source : string.Empty; string exMessage = e.Exception != null ? e.Exception.Message : string.Empty; MessageBoxs.Show(Trans.COM, exSource, exMessage, "发现异常", MessageBoxButtons.OK, MessageBoxIcon.Information); ExceptionBLL.WriteLogFileAndEmail(e); }
/// <summary> /// 前端检查-提现 /// </summary> /// <returns></returns> private bool ClientCheckForWithdrawal() { //验证密码 if (string.IsNullOrEmpty(txtWal_TradingPassword.Text.Trim())) { MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { MsgParam.PASSWORD }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } if (_withdrawalInfo.Wal_TradingPassword != CryptoHelp.EncodeToMD5(txtWal_TradingPassword.Text.Trim())) { //密码错误 MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.E_0011, new object[] { MsgParam.PASSWORD }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } //验证钱包 if (string.IsNullOrEmpty(txtWal_No.Text)) { //没有获取到钱包,提现失败 MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.W_0024, new object[] { MsgParam.WALLET, SystemActionEnum.Name.WITHDRAWCASH }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } WalletInfoUIModel curWallet = BLLCom.GetWalletByWalletNo(txtWal_No.Text); if (string.IsNullOrEmpty(curWallet.Wal_ID) || string.IsNullOrEmpty(curWallet.Wal_No)) { //没有获取到钱包,提现失败 MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.W_0024, new object[] { MsgParam.WALLET, SystemActionEnum.Name.WITHDRAWCASH }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } //验证本次提现金额 if (numThisWithdrawalAmount.Value == null || Convert.ToDecimal(numThisWithdrawalAmount.Value) == 0) { //本次提现金额不能为零! MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.E_0000, new object[] { MsgParam.WITHDRAWALAMOUNT_CANNOTZERO }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } if (curWallet.Wal_AvailableBalance < Convert.ToDecimal(numThisWithdrawalAmount.Value)) { //提现金额大于钱包可用余额,不能提现! MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.E_0017, new object[] { "提现金额大于钱包可用余额", SystemActionEnum.Name.WITHDRAWCASH }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } //确定要提现吗? DialogResult dialogResult = MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.I_0003, new object[] { SystemActionEnum.Name.WITHDRAWCASH }), MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dialogResult != DialogResult.OK) { return(false); } return(true); }
/// <summary> /// 前端检查 /// </summary> /// <returns></returns> private bool ClientCheck() { //验证姓名 if (string.IsNullOrEmpty(mcbUserName.SelectedText) || string.IsNullOrEmpty(mcbUserName.SelectedValue)) { MessageBoxs.Show(Trans.SM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { SystemTableColumnEnums.SM_User.Name.User_Name }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } return(true); }
/// <summary> /// 前端检查-删除 /// </summary> /// <returns></returns> private bool ClientCheckForDelete() { if (cbPFO_StatusName.Text == PurchaseForecastOrderStatusEnum.Name.YZCG) { MessageBoxs.Show(Trans.SM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0017, new object[] { PurchaseForecastOrderStatusEnum.Name.YZCG, SystemActionEnum.Name.DELETE }), MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } return(true); }
/// <summary> /// 添加仓位 /// </summary> private void AddWarehouseBin() { FrmWarehouseBinManager warehouseBinManager = new FrmWarehouseBinManager(); DialogResult dialogResult = warehouseBinManager.ShowDialog(); warehouseBinManager.warehouseBinManagerUIModel.WHB_WH_ID = txtWH_ID.Text.Trim(); if (dialogResult != DialogResult.OK) { return; } if (string.IsNullOrEmpty(warehouseBinManager.warehouseBinManagerUIModel.WHB_Name)) { //仓位名称不能为空 MessageBoxs.Show(Trans.PIS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { SystemTableColumnEnums.PIS_WarehouseBin.Name.WHB_Name }), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //接受仓位窗体传来的值 WarehouseBinManagerUIModel warehouseBin = new WarehouseBinManagerUIModel() { WHB_Name = warehouseBinManager.warehouseBinManagerUIModel.WHB_Name, WHB_Description = warehouseBinManager.warehouseBinManagerUIModel.WHB_Description, WHB_IsValid = warehouseBinManager.warehouseBinManagerUIModel.WHB_IsValid, WHB_VersionNo = warehouseBinManager.warehouseBinManagerUIModel.WHB_VersionNo, WHB_CreatedBy = warehouseBinManager.warehouseBinManagerUIModel.WHB_CreatedBy, WHB_CreatedTime = warehouseBinManager.warehouseBinManagerUIModel.WHB_CreatedTime, WHB_UpdatedBy = LoginInfoDAX.UserName, WHB_UpdatedTime = DateTime.Now, Tmp_SID_ID = warehouseBinManager.warehouseBinManagerUIModel.Tmp_SID_ID }; //判断传来仓位名称是否重复 foreach (var loopwarehouseBin in _warehouseBinList) { if (loopwarehouseBin.WHB_Name == warehouseBin.WHB_Name) { //仓位名称已存在 MessageBoxs.Show(Trans.PIS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0006, new object[] { SystemTableColumnEnums.PIS_WarehouseBin.Name.WHB_Name }), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } _warehouseBinList.Insert(0, warehouseBin); if (dialogResult == DialogResult.OK) { warehouseBinManager.Close(); gdGridWarehouseBin.DataSource = _warehouseBinList; gdGridWarehouseBin.DataBind(); //设置Grid自适应列宽(根据单元格内容) gdGridWarehouseBin.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.VisibleRows); //设置单元格样式 SetWarehouseStyle(); } }
private void ShowForm(string paramKey) { try { GC.Collect(); GC.WaitForPendingFinalizers(); if (Environment.OSVersion.Platform == PlatformID.Win32NT) { SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1); } #region 限制打开界面数 int maxViewCount = 15; if (_dicWorkForm.Count == maxViewCount) { MessageBoxs.Show(Trans.COM, this.ToString(), "为了保证用户体验,只能打开 " + maxViewCount + " 个界面,请关闭不常用的界面后再打开新界面。", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } #endregion if (!isAllowMuiltRun) { if (!_dicWorkForm.ContainsKey(paramKey)) { ObjectHandle t = Activator.CreateInstance(paramKey.Substring(0, paramKey.IndexOf(".Frm", StringComparison.Ordinal)), paramKey); var form = (Form)t.Unwrap(); _dicWorkForm.Add(paramKey, form); form.MdiParent = this; form.Show(); } else { _dicWorkForm[paramKey].Focus(); } } else { ObjectHandle t = Activator.CreateInstance(paramKey.Substring(0, paramKey.IndexOf(".Frm", StringComparison.Ordinal)), paramKey); var form = (Form)t.Unwrap(); _dicWorkForm.Add(Guid.NewGuid().ToString(), form); form.MdiParent = this; form.Show(); } } catch (Exception ex) { MessageBoxs.Show(Trans.COM, this.ToString(), ex.Message, MessageBoxButtons.OKCancel, MessageBoxIcon.Question); return; } }
/// <summary> /// 前端检查-保存 /// </summary> /// <returns></returns> private bool ClientCheckForSave() { //判断显示的是否为【列表】Tab if (string.IsNullOrEmpty(txtASAH_ARMerchant_Name.Text)) { //汽修商户名称不能为空 MessageBoxs.Show(Trans.SM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0001, new object[] { SystemTableColumnEnums.SM_AROrgSupMerchantAuthority.Name.ASAH_ARMerchant_Name }), MessageBoxButtons.OK, MessageBoxIcon.Information); txtASAH_ARMerchant_Name.Focus(); return(false); } return(true); }
/// <summary> /// 窗体加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmMaintainBrandPartsInfo_Load(object sender, EventArgs e) { //初始化控件 InitializeDetailTabControls(); #region 加载配件下拉列表 //配件名称 _autoPartsNameList = CacheDAX.Get(CacheDAX.ConfigDataKey.AutoPartsName) as List <MDLBS_AutoPartsName>; mcbVTPI_AutoPartsName.DisplayMember = SystemTableColumnEnums.BS_AutoPartsName.Code.APN_Name; mcbVTPI_AutoPartsName.ValueMember = SystemTableColumnEnums.BS_AutoPartsName.Code.APN_Name; mcbVTPI_AutoPartsName.DataSource = _autoPartsNameList; #endregion #region 处理参数 if (_viewParameters != null) { //传入Model if (_viewParameters.ContainsKey(ComViewParamKey.DestModel.ToString())) { _brandPartsInfo = _viewParameters[ComViewParamKey.DestModel.ToString()] as VehicleThirdPartsInfoUIModel; if (_brandPartsInfo != null) { //第三方编码 txtVBPI_ThirdNo.Text = _brandPartsInfo.VTPI_ThirdNo; //配件名称 mcbVTPI_AutoPartsName.SelectedValue = _brandPartsInfo.VTPI_AutoPartsName; //配件品牌 txtVBPI_AutoPartsBrand.Text = _brandPartsInfo.VTPI_AutoPartsBrand; //备注 txtVBPI_Remark.Text = _brandPartsInfo.VTPI_Remark; } } //MaintainBrandPartsInfoFunc if (_viewParameters.ContainsKey(BSViewParamKey.MaintainBrandPartsInfo.ToString())) { var tempFunc = _viewParameters[BSViewParamKey.MaintainBrandPartsInfo.ToString()] as Func <VehicleThirdPartsInfoUIModel, bool>; if (tempFunc != null) { _maintainBrandPartsInfoFunc = tempFunc; } else { MessageBoxs.Show(Trans.BS, this.ToString(), "请传入Func<VehicleThirdPartsInfoUIModel, bool>,以便处理原厂件信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } } #endregion }
/// <summary> /// 保存 /// </summary> public override void SaveAction() { //1.前端检查-保存 if (!ClientCheckForSave()) { return; } //2.将【详情】Tab内控件的值赋值给基类的DetailDS SetCardCtrlsToDetailDS(); //3.执行保存(含服务端检查) //4.将DetailDS数据赋值给【详情】Tab内的对应控件 SetDetailDSToCardCtrls(); MessageBoxs.Show(Trans.SM, this.ToString(), "保存成功!", MessageBoxButtons.OK, MessageBoxIcon.Information); }
/// <summary> /// 充值 /// </summary> public override void WalletDepositMoney() { //待充值的钱包 WalletInfoUIModel walletToDeposit = new WalletInfoUIModel(); if (tabControlFull.Tabs[SysConst.EN_DETAIL].Selected) { //选中【详情】Tab的场合 _bll.CopyModel(DetailDS, walletToDeposit); } else { //选中【列表】Tab的场合 gdGrid.UpdateData(); var selectedWalletList = GridDS.Where(x => x.IsChecked == true).ToList(); if (selectedWalletList.Count == 0 || selectedWalletList.Count > 1) { //请选择一个钱包进行充值 MessageBoxs.Show(Trans.RIA, this.ToString(), MsgHelp.GetMsg(MsgCode.W_0006, new object[] { MsgParam.ONE + SystemTableEnums.Name.EWM_Wallet, SystemNavigateEnum.Name.DEPOSITMONEY }), MessageBoxButtons.OK, MessageBoxIcon.Information); for (int i = 0; i < selectedWalletList.Count; i++) { if (i != 0) { selectedWalletList[i].IsChecked = false; } gdGrid.DataSource = GridDS; gdGrid.DataBind(); } return; } _bll.CopyModel(selectedWalletList[0], walletToDeposit); } if (string.IsNullOrEmpty(walletToDeposit.Wal_ID) || string.IsNullOrEmpty(walletToDeposit.Wal_No)) { //没有获取到钱包,充值失败 MessageBoxs.Show(Trans.RIA, ToString(), MsgHelp.GetMsg(MsgCode.W_0024, new object[] { MsgParam.WALLET, SystemActionEnum.Name.RECHARGE }), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Dictionary <string, object> paramViewParameters = new Dictionary <string, object> { //钱包相关信息 { RIAViewParamKey.WalletInfo.ToString(), walletToDeposit }, }; //跳转到[钱包充值] SystemFunction.ShowViewFromView(MsgParam.WALLET_DEPOSITMONEY, ViewClassFullNameConst.RIA_FrmWalletDepositMoney, true, PageDisplayMode.TabPage, paramViewParameters, null); }