private void btnAudit_Click(object sender, RoutedEventArgs e) { if (!AuthMgr.HasFunctionPoint(AuthKeyConst.Invoice_PriceChange_Audit)) { //Window.Alert("不能进行审核操作,你没有审核权限!"); Window.Alert(ResPriceChangeQuery.Msg_NoAuditAuthority); return; } UCPriceChangeSetter uc = new UCPriceChangeSetter(); uc.IsBatchModel = true; IDialog dialog = Window.ShowDialog(ResPriceChangeQuery.Msg_AudtiMemo, uc, (obj1, args1) => { if (args1.DialogResult == DialogResultType.OK) { string auditMemo = Convert.ToString(args1.Data); var SysList = from item in this.resultCollection where item.IsChecked == true select item.SysNo.Value; if (SysList.Count() > 0) { Dictionary <int, string> dic = new Dictionary <int, string>(); foreach (var item in SysList) { dic.Add(item, auditMemo); } facade.BatchAuditPriceChange(dic, (msg) => { Window.Alert(ResPriceChangeQuery.Msg_Tips, msg, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information, (obj, args) => { this.resultgd.Bind(); }); }); } else { //Window.Alert("请至少选择一条记录!"); Window.Alert(ResPriceChangeQuery.Msg_SelectRecord); } } }); uc.DialogHanlder = dialog; }
private void btnChangeRate_Click(object sender, RoutedEventArgs e) { UCPriceChangeSetter uc = new UCPriceChangeSetter(this.vm); IDialog dialog = Window.ShowDialog(ResPriceChangeMaintain.Msg_SetProportion, uc, (obj1, args1) => { if (args1.DialogResult == DialogResultType.OK) { decimal rate = Convert.ToDecimal(args1.Data); foreach (var item in this.vm.ItemList) { if (this.vm.PriceType == RequestPriceType.SalePrice) { item.NewPrice = (item.OldPrice * rate).ToString("F2"); //item.NewShowPrice = (item.OldShowPrice * rate).ToString("F2"); // when newprice change update lessthangrossprofit. if (item.NewPrice != null && item.NewPrice.Trim().Length > 0) { if (((Convert.ToDecimal(item.NewPrice) - item.UnitCost) / item.UnitCost) < item.MinMargin) { //item.LessThanGrossProfit = "是"; item.LessThanGrossProfit = ResPriceChangeMaintain.Msg_Yes; } else { //item.LessThanGrossProfit = "否"; item.LessThanGrossProfit = ResPriceChangeMaintain.Msg_No; } } } else { item.NewInstockPrice = (item.OldInstockPrice * rate).ToString("F2"); } } } }); uc.DialogHanlder = dialog; }
private void btnAudit_Click(object sender, RoutedEventArgs e) { if (!AuthMgr.HasFunctionPoint(AuthKeyConst.Invoice_PriceChange_Audit)) { //Window.Alert("不能进行审核操作,你没有审核权限!"); Window.Alert(ResPriceChangeMaintain.Msg_NoAuditAuthority); return; } UCPriceChangeSetter uc = new UCPriceChangeSetter(this.vm); uc.IsAuditModel = true; IDialog dialog = Window.ShowDialog(null, uc, (obj1, args1) => { if (args1.DialogResult == DialogResultType.OK) { this.vm.AudtiMemo = Convert.ToString(args1.Data); if (!string.IsNullOrEmpty(this.vm.AudtiMemo)) { Dictionary <int, string> dic = new Dictionary <int, string>(); dic.Add(this.vm.SysNo.Value, this.vm.AudtiMemo); facade.BatchAuditPriceChange(dic, (msg) => { Window.Alert(ResPriceChangeMaintain.Msg_Tips, msg, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information, (obj, args) => { Window.Refresh(); }); }); } else { //Window.Alert("请输入审核备注信息!"); Window.Alert(ResPriceChangeMaintain.Msg_NeedEnterMemoInfo); } } }); uc.DialogHanlder = dialog; }