public int GetPrice(int PriceMode) { //计算封面的材料和工艺 if (Cover != null) { Init(Cover); AllPrice = new Model.ResultPrice(); //计算印刷列表 if (PrintList == null) { PrintList = GetPrintUnitByProduct(Cover); } //计算产品重量和纸张重量; AllWeight = Cover.weight; PaperWeight = GetPaperWeigh(Cover); } if (Inner != null && BindType > 0) { foreach (ProductUnit pu in Inner) { Init(pu); //计算印刷列表 PrintList.InsertRange(0, GetPrintUnitByProduct(pu)); //计算产品重量和纸张重量; AllWeight += pu.weight; PaperWeight += GetPaperWeigh(pu); } } GetProductPrice(); return(AllPrice.CalPrice(PriceMode)); }
public asklist() { Asker = new Model.P_AskList(); UserRequest = new Model.Requset(); Price = new Model.ResultPrice(); Asker.AskTime = DateTime.Now; }
/// <summary> /// 得到一个产品的结果 /// </summary> /// <returns></returns> public void GetProductPrice() { int paperprice, psprice, processprice, printprice, materialprice, bindprice; paperprice = 0; psprice = 0; processprice = 0; printprice = 0; materialprice = 0; bindprice = 0; if (Process != null) { List <Model.P_ProcessList> tp = new List <Model.P_ProcessList>(); foreach (Model.P_ProcessList w in Process) { Model.P_ProcessList p0 = CheckProcess(w); if (p0 != null) { tp.Add(p0); } } if (tp.Count > 0) { Process.AddRange(tp); } foreach (Model.P_ProcessList w in Process) { if (w.PType == 1) { printprice += w.Price; } if (w.PType == 2) { bindprice += w.Price; } if (w.PType != 1 && w.PType != 2) { processprice += w.Price; } } } if (AllMaterial != null) { foreach (Model.P_MaterialList m in AllMaterial) { if (m.MType == 1) { paperprice += m.Price; } if (m.MType == 2) { psprice += m.Price; } if (m.MType != 1 && m.MType != 2) { materialprice += m.Price; } } } if (AllPrice == null) { AllPrice = new Model.ResultPrice(); } AllPrice.AddPrice(paperprice, psprice, materialprice, printprice, bindprice, processprice); }
/// <summary> /// 计算价格,1为成本价,2为高级客户价,3为外部报价 /// </summary> /// <param name="rp"></param> /// <param name="mode"></param> /// <returns></returns> public int MakePrice(Model.ResultPrice rp, int mode) { return(0); }