1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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);
        }
    }
}