111
yantian yue
2023-12-28 7820f50a29b75e0704e6e1dcfdaf2e85397c66a8
提交 | 用户 | 时间
e46d3b 1 using System;
2 using System.Collections.Generic;
3 using System.Data.Entity;
4 using System.Linq;
5 using System.Text;
6 using YX.DAL;
7 using YX.Entity;
8
9 namespace YX.BLL
10 {
11     public class SystemAppendProperty_Bll
12     {
13         SystemAppendProperty_Dal append_dal = new SystemAppendProperty_Dal();
14         //业务功能列表
15         public List<string> GetAppendPropertys()
16         {
17             try
18             {
19                 return append_dal.GetAppendPropertys();
20             }
21             catch (Exception ex)
22             {
23                 
24                 throw ex;
25             }
26   
27
28         }
29         //具体业务功能属性列表
30         public List<Base_AppendProperty> AppendProperty_List(string Property_Function)
31         {
32             try
33             {
34                 //using (Sam_DBEntities db = new Sam_DBEntities())
35                 //{
36                 //  return   db.Base_AppendProperty.Where(o=>o.DeleteMark==1 && o.Property_Function== Property_Function).OrderBy(o=>o.SortCode).ToList();
37                 //}
38                 return append_dal.AppendProperty_List(Property_Function);
39             }
40             catch (Exception ex)
41             {
42                 
43                 throw ex;
44             }
45         }
46
47         /// <summary>
48         /// 根据业务名称获取附加属性值
49         /// </summary>
50         /// <param name="Property_Function">所属功能</param>
51         /// <param name="Obj_ID">业务主键</param>
52         /// <returns></returns>
53         public List<Base_AppendPropertyInstance> GetPropertyInstancepk(string Property_Function, string Obj_ID)
54         {
55             try
56             {
57                 //StringBuilder item_value = new StringBuilder();
58                 //using (Sam_DBEntities db = new Sam_DBEntities())
59                 //{
60                 //    var query = from I in db.Base_AppendPropertyInstance
61                 //                join A in db.Base_AppendProperty
62                 //                on I.Property_Control_ID equals A.Property_Control_ID
63                 //                where I.Base_UserInfo.User_ID == Obj_ID && A.Property_Function == Property_Function
64                 //                select I;
65                 //    return query.ToList();
66                 //}
67                 return append_dal.GetPropertyInstancepk(Property_Function, Obj_ID);
68             }
69             catch (Exception)
70             {
71                 
72                 throw;
73             }
74
75         }
76         /// <summary>
77         /// 添加属性
78         /// </summary>
79         /// <returns></returns>
80         public int AddAppendProperty(Base_AppendProperty info)
81         {
82             try
83             {
84                 //using (Sam_DBEntities db = new Sam_DBEntities())
85                 //{
86                 //    db.Base_AppendProperty.Add(info);
87                 //    return db.SaveChanges();
88                 //}
89                 return append_dal.AddAppendProperty(info);
90             }
91             catch (Exception ex)
92             {
93                 
94                 throw ex;
95             }
96         }
97         /// <summary>
98         /// 修改属性
99         /// </summary>
100         /// <param name="info"></param>
101         /// <returns></returns>
102         public int UpdateAppendProertty(Base_AppendProperty info)
103         {
104             try
105             {
106                 //using (Sam_DBEntities db = new Sam_DBEntities())
107                 //{
108                 //    db.Base_AppendProperty.Attach(info);
109                 //    db.Entry(info).State = System.Data.Entity.EntityState.Modified;
110                 //    return db.SaveChanges();
111                 //}
112                 return append_dal.UpdateAppendProertty(info);
113             }
114             catch (Exception ex)
115             {
116                 
117                 throw ex;
118             }
119         }
120         /// <summary>
121         /// 删除属性
122         /// </summary>
123         /// <param name="Property_ID"></param>
124         /// <returns></returns>
125         public int DeleteAppendProettty(string Property_ID)
126         {
127             try
128             {
129                 //using (Sam_DBEntities db=new Sam_DBEntities())
130                 //{
131                 //    var obj = new Base_AppendProperty { Property_ID= Property_ID };
132                 //    db.Base_AppendProperty.Attach(obj);
133                 //    db.Base_AppendProperty.Remove(obj);
134                 //    return db.SaveChanges();
135                 //}
136                 return append_dal.DeleteAppendProettty(Property_ID);
137             }
138             catch (Exception ex)
139             {
140
141                 throw ex;
142             }
143         }
144     }
145 }