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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CY.IDAL;
using CY.Model;
using AbstractFactory;
using CY.IBaseDAL;
using CY.Infrastructure.DESEncrypt;
using CY.Infrastructure.Query;
using System.Data;
namespace CY.BLL
{
    /// <summary>
    /// 资讯分类的业务逻辑类
    /// </summary>
    public class Info_SortBLL
    {
        IInfo_SortDAL _IInfo_SortDal = null;
        /// <summary>
        /// 初始化构造
        /// </summary>
        public Info_SortBLL()
        {
            //获取Info_Sort DAL实现
            _IInfo_SortDal = Factory.GetDALByInterfaceName(DALInterface.IInfo_SortDAL) as IInfo_SortDAL;
        }
 
        /// <summary>
        /// 新增分类
        /// </summary>
        /// <param name="rType"></param>
        /// <param name="m_OA_CustomerCommunications"></param>
        /// <param name="m_EC_AcceptWayByCustomers"></param>
        /// <returns></returns>
        public bool InsertModel(CY.Model.Info_Sort m_Info_Sort)
        {
            try
            {
                return _IInfo_SortDal.InserModel(m_Info_Sort);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 
        /// <summary>
        /// 修改分类
        /// </summary>
        /// <param name="rType"></param>
        /// <returns></returns>
        public bool UpdateModel(CY.Model.Info_Sort m_Info_Sort)
        {
            try
            {
                return _IInfo_SortDal.UpdateModel(m_Info_Sort);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 
        /// <summary>
        /// 删除分类
        /// </summary>
        /// <param name="rType"></param>
        /// <returns></returns>
        public bool DeleteModel(CY.Model.Info_Sort rType)
        {
            try
            {
                _IInfo_SortDal.DeleteModel(rType);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return true;
        }
 
 
        /// <summary>
        /// 删除分类及分类下信息
        /// </summary>
        /// <param name="Keyid"></param>
        /// <returns></returns>
        public bool DeleteModelAll(int? Keyid)
        {
            try
            {
                return _IInfo_SortDal.DeleteModelAll(Keyid);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 
        /// <summary>
        /// 根据上级编号查询全部分类
        /// </summary>
        /// <param name="ParentId">编号</param>
        /// <returns></returns>
        public IEnumerable<Info_Sort> SelectListByParentId(int? ParentId)
        {
            try
            {
                return _IInfo_SortDal.SelectListByParentId(ParentId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 
 
        /// <summary>
        /// 根据编号查询单个信息
        /// </summary>
        /// <param name="Keyid">编号</param>
        /// <returns></returns>
        public Info_Sort SelectModelByKeyId(int? KeyId)
        {
            try
            {
                return _IInfo_SortDal.SelectModelByKeyId(KeyId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 
         /// <summary>
        /// 查询全部分类
        /// </summary>
        /// <returns></returns>
        public DataTable SelectList(Guid FirmId)
        {
            try
            {
                return _IInfo_SortDal.SelectList(FirmId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}