Exemple #1
0
        //更新扣款项信息
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            string name = this.txtName.Text.Trim();

            //扣款名称验证(必填,长度不超过200)
            if (string.IsNullOrEmpty(name))
            {
                Window.Alert(ResDeductQuery.AlertMsg_NameRequired);
                return;
            }
            else
            {
                if (name.Length > 200)
                {
                    return;
                }
                else
                {
                    deductVm.Name = name;
                }
            }

            deductVm.DeductType   = this.rdbContract.IsChecked == true ? DeductType.Contract : DeductType.Temp;
            deductVm.AccountType  = this.rdbFee.IsChecked == true ? AccountType.Fee : AccountType.Cost;
            deductVm.DeductMethod = this.rdbUnCash.IsChecked == true ? DeductMethod.UnCash : DeductMethod.Cash;


            Deduct oprDeductInfo = EntityConverter <DeductQueryVM, Deduct> .Convert(deductVm);

            if (null != getLoadDeductSysNo)
            {
                Window.Confirm(ResDeductQuery.InfoMsg_ConfirmModify, (obj, args) =>
                {
                    if (args.DialogResult == DialogResultType.OK)
                    {
                        //更新
                        deductFacade.UpdateDeductInfo(oprDeductInfo, (obj2, args2) =>
                        {
                            if (args2.FaultsHandle())
                            {
                                return;
                            }

                            Window.Alert(ResDeductQuery.AlertMsg_UpdateSuc);
                            Window.Navigate("/ECCentral.Portal.UI.PO/DeductQuery");
                            return;
                        });
                    }
                });
            }
            else
            {
                //新增
                deductFacade.AddDeductInfo(deductVm, (obj3, args3) =>
                {
                    if (args3.FaultsHandle())
                    {
                        return;
                    }

                    Window.Alert(ResDeductQuery.AlertMsg_CreateSuc);
                    Window.Navigate("/ECCentral.Portal.UI.PO/DeductQuery");
                    return;
                });
            }
        }
Exemple #2
0
        //编辑&新增扣款项目
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            string name = this.txtName.Text.Trim();

            //扣款名称验证(必填,长度不超过200)
            if (string.IsNullOrEmpty(name))
            {
                CurrentWindow.Alert(ResDeductQuery.AlertMsg_NameRequired);
                return;
            }
            else
            {
                if (name.Length > 200)
                {
                    return;
                }
                else
                {
                    deductVM.Name = name;
                }
            }

            deductVM.DeductType   = this.rdbContract.IsChecked == true ? DeductType.Contract : DeductType.Temp;
            deductVM.AccountType  = this.rdbFee.IsChecked == true ? AccountType.Fee : AccountType.Cost;
            deductVM.DeductMethod = this.rdbUnCash.IsChecked == true ? DeductMethod.UnCash : DeductMethod.Cash;


            Deduct oprDeductInfo = EntityConverter <DeductQueryVM, Deduct> .Convert(deductVM);

            if (null != getLoadDeductSysNo)
            {
                //CurrentWindow.Alert("温馨提示:",ResDeductQuery.InfoMsg_ConfirmModify,MessageType.Information,(obj4, args4) =>
                //{
                //    if (args4.DialogResult == DialogResultType.OK)
                //    {
                //更新
                serviceFacade.UpdateDeductInfo(oprDeductInfo, (obj2, args2) =>
                {
                    if (args2.FaultsHandle())
                    {
                        return;
                    }

                    CurrentWindow.Alert(ResDeductQuery.AlertMsg_UpdateSuc);
                    Dialog.ResultArgs.Data         = null;
                    Dialog.ResultArgs.DialogResult = DialogResultType.OK;
                    Dialog.Close(true);
                });
                //    }
                //});
            }
            else
            {
                //新增
                serviceFacade.AddDeductInfo(deductVM, (obj3, args3) =>
                {
                    if (args3.FaultsHandle())
                    {
                        return;
                    }

                    CurrentWindow.Alert(ResDeductQuery.AlertMsg_CreateSuc);
                    Dialog.ResultArgs.Data         = null;
                    Dialog.ResultArgs.DialogResult = DialogResultType.OK;
                    Dialog.Close(true);
                    //return;
                });
            }
        }