private void NewCalSalary(Bu_CalSalaryGen v) { SalaryCal salaryCal = SalaryFactory.GetSalaryCal(v.Odr_Type, v.Odr_No_Main, v); bool hasSalary = salaryCal.HasSalary(); if (hasSalary) { salaryCal.DoCal(); } }
private void Money(ToolStripButton sender) { if (mDataGridResult.CurrentRow == null) { return; } Model.Info_salary_main oldSalary = mDataGridResult.GetCurrentEntity() as Model.Info_salary_main; string msg = string.Format("确定重新计算:{0}合同编号提成?", oldSalary.Odr_No_Main); if (!Miles.Framework.UI.Function.Dialog.ShowQuestionYesNo(msg)) { return; } Bu_CalSalaryGen salaryGen = manager.FindTheCalSalaryGenList(oldSalary.Odr_No_Main); if (salaryGen.Items.Count == 0) { salaryGen.Items = manager.GetOrderAllProductItems(salaryGen.Odr_No_Main); } if (salaryGen.BuildItems.Count == 0) { salaryGen.BuildItems = manager.GetBuildItems(salaryGen.Odr_No_Main); } if (salaryGen.FreightItems.Count == 0) { salaryGen.FreightItems = manager.GetFreightItems(salaryGen.Odr_No_Main); } if (salaryGen.Odr_Type == 1) { FmGuidePriceInfo fm = new FmGuidePriceInfo(); fm.mDecimalInput1.Value = oldSalary.Guide_Price; fm.SelectValue += (obj) => { decimal value = (decimal)obj; salaryGen.GuidePrice = value; }; if (fm.ShowDialog() != DialogResult.OK) { return; } } if (NewCalSalary(salaryGen)) { Query(null); } }
private bool NewCalSalary(Bu_CalSalaryGen v) { SalaryCal salaryCal = SalaryFactory.GetSalaryCal(v.Odr_Type, v.Odr_No_Main, v); bool hasSalary = salaryCal.HasSalary(); if (hasSalary) { return(salaryCal.DoCal()); } return(false); }
public List <Bu_CalSalaryGen> QueryNeedCalSalaryGenList() { List <Info_fin_order_gen> list = this.Repository.Find() .From <Model.Tb_fin_order_gen>() .Select().End() .Where() .And(Tb_fin_order_gen.Table.Is_Salary, (int)Enum.IsFlag.No) .And(Tb_fin_order_gen.Table.Tot_Cost, Miles.Coro.ORM.DbCompareChar.More, 0) .AndField(Tb_fin_order_gen.Table.Pay_Cost, Miles.Coro.ORM.DbCompareChar.MoreEqual, Tb_fin_order_gen.Table.Tot_Cost) .End() .ToQuery() .ToList <Info_fin_order_gen>(); var queryMain = from item in list where item.Odr_Type != 4 select item; Dictionary <string, Bu_CalSalaryGen> dicSalary = new Dictionary <string, Bu_CalSalaryGen>(); foreach (var v in queryMain) { Bu_CalSalaryGen salaryGen = Miles.Coro.Common.Utils.CopyToOther <Info_fin_order_gen, Bu_CalSalaryGen>(v); dicSalary.Add(v.Odr_No_Main, salaryGen); } var queryAdd = from item in list where item.Odr_Type == 4 select item; foreach (var v in queryAdd) { if (dicSalary.ContainsKey(v.Odr_No_Main)) { dicSalary[v.Odr_No_Main].Tot_Cost += v.Tot_Cost; dicSalary[v.Odr_No_Main].Pay_Cost += v.Pay_Cost; } } return(dicSalary.Values.ToList <Bu_CalSalaryGen>()); }