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;
|
using CY.BLL.EC;
|
|
namespace CY.BLL.Inquiry
|
{
|
/// <summary>
|
/// 厂商快速设置操作类
|
/// </summary>
|
public class FastSetByFirmBLL
|
{
|
IFastSetByFirmDAL _iFastSetByFirmDAL = null;
|
EC_SellerBusinessLimitsBLL _eC_SellerBusinessLimitsBLL = null;
|
public FastSetByFirmBLL()
|
{
|
_iFastSetByFirmDAL = Factory.GetDALByInterfaceName(DALInterface.IFastSetByFirmDAL) as IFastSetByFirmDAL;
|
_eC_SellerBusinessLimitsBLL = new EC_SellerBusinessLimitsBLL();
|
}
|
|
/// <summary>
|
/// 获取厂商快速设置
|
/// </summary>
|
/// <param name="firmId"></param>
|
/// <param name="customerId"></param>
|
/// <returns></returns>
|
public IList<Inquiry_FastSetByFirm> GetModelList(Guid firmId,Guid customerId)
|
{
|
IList<Inquiry_FastSetByFirm> list= _iFastSetByFirmDAL.GetModelList(firmId,customerId);
|
list = list.Where(p => _eC_SellerBusinessLimitsBLL.IsUsed(p.PrintTypeId, firmId)).ToList<Inquiry_FastSetByFirm>();
|
return list;
|
}
|
|
/// <summary>
|
/// 根据印刷类型获取厂商快速设置
|
/// </summary>
|
/// <param name="firmId"></param>
|
/// <param name="customerId"></param>
|
/// <param name="printTypeId"></param>
|
/// <returns></returns>
|
public Inquiry_FastSetByFirm GetModel(Guid firmId, Guid customerId, int printTypeId)
|
{
|
IList<Inquiry_FastSetByFirm> list = GetModelList(firmId, customerId);
|
Inquiry_FastSetByFirm model = list.SingleOrDefault<Inquiry_FastSetByFirm>(p => p.PrintTypeId == printTypeId) as Inquiry_FastSetByFirm;
|
return model;
|
}
|
|
/// <summary>
|
/// 保存厂商快速设置
|
/// </summary>
|
/// <param name="list"></param>
|
/// <param name="firmId"></param>
|
/// <param name="customerId"></param>
|
/// <returns></returns>
|
public bool SaveModelList(IList<Inquiry_FastSetByFirm> modelList)
|
{
|
return _iFastSetByFirmDAL.SaveModelList(modelList);
|
}
|
|
/// <summary>
|
/// 判断是否存在
|
/// </summary>
|
/// <param name="model"></param>
|
/// <param name="firmId"></param>
|
/// <param name="customerId"></param>
|
/// <returns></returns>
|
public bool IsExits(Guid firmId, Guid customerId, int printTypeId)
|
{
|
return _iFastSetByFirmDAL.IsExits(firmId, customerId, printTypeId);
|
}
|
}
|
}
|