using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using CY.IDAL.Inquiry;
|
using AbstractFactory;
|
using CY.Model;
|
using CY.Infrastructure.Query;
|
using CY.IDAL;
|
using CY.IBaseDAL;
|
using CY.Infrastructure;
|
namespace CY.BLL.Inquiry
|
{
|
/// <summary>
|
/// 品牌相关业务逻辑类
|
/// </summary>
|
public class BrandInfoBLL
|
{
|
IBrandInfoDAL _iBrandInfoDAL = null;
|
|
public BrandInfoBLL()
|
{
|
_iBrandInfoDAL = Factory.GetDALByInterfaceName(DALInterface.IBrandInfoDAL) as IBrandInfoDAL;
|
}
|
|
/// <summary>
|
/// 新增品牌
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
public bool InsertBrand(SysInquiry_BrandInfo model, SysInquiry_BrandListByPaper brandPaper, SysInquiry_PaperInfo paperModel)
|
{
|
return _iBrandInfoDAL.InsertBrandModel(model, brandPaper, paperModel);
|
}
|
|
/// <summary>
|
/// 修改品牌
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
public bool UpdateBrand(SysInquiry_BrandInfo model,SysInquiry_BrandListByPaper brandPaper, SysInquiry_PaperInfo paperModel,SysInquiry_PaperInfo orPaperModel)
|
{
|
return _iBrandInfoDAL.UpdateBrandModel(model,brandPaper,paperModel,orPaperModel);
|
}
|
|
/// <summary>
|
/// 删除品牌
|
/// </summary>
|
/// <param name="model"></param>
|
/// <returns></returns>
|
public bool DeleteBrand(SysInquiry_BrandInfo model)
|
{
|
return _iBrandInfoDAL.UpdateModel(model);
|
}
|
|
/// <summary>
|
/// 分页获取品牌列表
|
/// </summary>
|
/// <param name="brandName">品牌名称</param>
|
/// <param name="pa">分页参数</param>
|
/// <returns></returns>
|
public IEnumerable<SysInquiry_BrandInfo> GetBrandListByPaging(int paperTypeId, int paperId, string brandName, int status, Pagination pa)
|
{
|
return _iBrandInfoDAL.SelectModelPage(paperTypeId,paperId, brandName, status, pa);
|
}
|
|
/// <summary>
|
/// 根据主键获取品牌实体
|
/// </summary>
|
/// <param name="key"></param>
|
/// <returns></returns>
|
public SysInquiry_BrandInfo SelectModelByKey(int key)
|
{
|
return _iBrandInfoDAL.SelectModelByKey(key);
|
}
|
|
/// <summary>
|
/// 判断是否有相同的品牌名称
|
/// </summary>
|
/// <param name="brandName"></param>
|
/// <returns></returns>
|
public bool IsExistsBrandName(string brandName, int PaperId)
|
{
|
return _iBrandInfoDAL.IsExistsBrandName(brandName, PaperId);
|
}
|
|
/// <summary>
|
/// 批量删除品牌
|
/// </summary>
|
/// <param name="keyIds"></param>
|
/// <returns></returns>
|
public bool DeleteBrandInfoList(List<int> keyIds)
|
{
|
return _iBrandInfoDAL.DeleteBrandInfoList(keyIds);
|
}
|
|
/// <summary>
|
/// 返回所有有效的品牌列表
|
/// </summary>
|
/// <returns></returns>
|
public IEnumerable<SysInquiry_BrandInfo> GetBrandList()
|
{
|
return _iBrandInfoDAL.GetBrandList();
|
}
|
|
/// <summary>
|
/// 获取最新排序顺序
|
/// </summary>
|
/// <returns></returns>
|
public int GetOrderNumByMax(int paperId)
|
{
|
return _iBrandInfoDAL.GetOrderNumByMax(paperId);
|
}
|
}
|
}
|