public SupplyDataModel() { OverTime = new RebarTypeRetModel(); OnTime = new RebarTypeRetModel(); OverTimeNoSupply = new RebarTypeRetModel(); NoSupply = new RebarTypeRetModel(); }
/// <summary> /// 计算差额 /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> private decimal GetDifferenceData(RebarTypeRetModel a, RebarTypeRetModel b) { var total = a.TotalWeight - b.TotalWeight; if (total < 0) { a.TooFew = true; } else if (total > 0) { a.TooMuch = true; } return(total); }
private RawMaterialStockModel CreateDifferenceRetData(RawMaterialStockModel a, RawMaterialStockModel b) { var ret = new RawMaterialStockModel(); //建筑钢筋 var Building = new RebarTypeRetModel(); if (a != null && b != null) { Building.TotalWeight = GetDifferenceData(a.BuildingSteel, b.BuildingSteel); } ret.BuildingSteel = Building; //型钢 var Steel = new RebarTypeRetModel(); if (a != null && b != null) { Steel.TotalWeight = GetDifferenceData(a.SectionSteel, b.SectionSteel); } ret.SectionSteel = Steel; return(ret); }
public RawMaterialStockModel(List <PlanDataModel> data) { //建筑钢筋 var Building = new RebarTypeRetModel(); if (data != null) { var b = data.Where(p => p.RebarType == "BuildingSteel").ToList(); Building.TotalWeight = b.Sum(p => p.TotalWeight); Building.Count = b.Count; } this.BuildingSteel = Building; //型钢 var Steel = new RebarTypeRetModel(); if (data != null) { var s = data.Where(p => p.RebarType == "SectionSteel").ToList(); Steel.TotalWeight = s.Sum(p => p.TotalWeight); Steel.Count = s.Count; } this.SectionSteel = Steel; }
public RawMaterialStockModel() { SectionSteel = new RebarTypeRetModel(); BuildingSteel = new RebarTypeRetModel(); }