using System; using System.Collections.Generic; using System.Linq; using System.Text; using CY.IDAL.Inquiry; using AbstractFactory; using CY.Model; using CY.Model.Inquiry; namespace CY.BLL.Inquiry { /// /// 粘信封业务逻辑类 /// public class StickEnvelopeCostBLL { IStickEnvelopeCostDAL _iStickEnvelopeCostDAL = null; public StickEnvelopeCostBLL() { _iStickEnvelopeCostDAL = Factory.GetDALByInterfaceName(DALInterface.IStickEnvelopeCostDAL) as IStickEnvelopeCostDAL; } /// /// 获取粘信封价格列表 /// /// /// /// public IList GetModelList(Guid inquiryId, int printingTyId, int afterParameterId) { return _iStickEnvelopeCostDAL.GetModelList(inquiryId, printingTyId, afterParameterId); } /// /// 保存粘信封价格列表 /// /// /// /// /// public bool SaveModelList(IList list, InquiryCondition inquiryCondition, int printingTyId) { return _iStickEnvelopeCostDAL.SaveModelList(list, inquiryCondition, printingTyId); } /// /// 获取粘信封 /// /// /// /// /// public Inquiry_StickEnvelopeCost GetModel(int printingTyId, int envelopeModeTypeId, int afterParameterId, Guid inquiryId) { IList list = GetModelList(inquiryId, printingTyId, afterParameterId); Inquiry_StickEnvelopeCost model = list.Single(p => p.EnvelopeModeTypeId == envelopeModeTypeId) as Inquiry_StickEnvelopeCost; return model; } /// /// 获取粘信封价格 /// /// /// /// /// public decimal GetStickEnvelopePrice(int printingTyId, int envelopeModeTypeId, int printCount, int afterParameterId, Guid inquiryId) { decimal price = 0; Inquiry_StickEnvelopeCost model = GetModel(printingTyId, envelopeModeTypeId,afterParameterId, inquiryId); price = model.Price * printCount; if (price <= model.StartPrice) price = model.StartPrice; return price; } } }