懒羊羊
2023-12-28 e46d3baaf3e8d7d85f4bafec3aad75e52b078408
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
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using YX.DAL;
using YX.Entity;
 
namespace YX.BLL
{
    public class SystemAppendProperty_Bll
    {
        SystemAppendProperty_Dal append_dal = new SystemAppendProperty_Dal();
        //业务功能列表
        public List<string> GetAppendPropertys()
        {
            try
            {
                return append_dal.GetAppendPropertys();
            }
            catch (Exception ex)
            {
                
                throw ex;
            }
  
 
        }
        //具体业务功能属性列表
        public List<Base_AppendProperty> AppendProperty_List(string Property_Function)
        {
            try
            {
                //using (Sam_DBEntities db = new Sam_DBEntities())
                //{
                //  return   db.Base_AppendProperty.Where(o=>o.DeleteMark==1 && o.Property_Function== Property_Function).OrderBy(o=>o.SortCode).ToList();
                //}
                return append_dal.AppendProperty_List(Property_Function);
            }
            catch (Exception ex)
            {
                
                throw ex;
            }
        }
 
        /// <summary>
        /// 根据业务名称获取附加属性值
        /// </summary>
        /// <param name="Property_Function">所属功能</param>
        /// <param name="Obj_ID">业务主键</param>
        /// <returns></returns>
        public List<Base_AppendPropertyInstance> GetPropertyInstancepk(string Property_Function, string Obj_ID)
        {
            try
            {
                //StringBuilder item_value = new StringBuilder();
                //using (Sam_DBEntities db = new Sam_DBEntities())
                //{
                //    var query = from I in db.Base_AppendPropertyInstance
                //                join A in db.Base_AppendProperty
                //                on I.Property_Control_ID equals A.Property_Control_ID
                //                where I.Base_UserInfo.User_ID == Obj_ID && A.Property_Function == Property_Function
                //                select I;
                //    return query.ToList();
                //}
                return append_dal.GetPropertyInstancepk(Property_Function, Obj_ID);
            }
            catch (Exception)
            {
                
                throw;
            }
 
        }
        /// <summary>
        /// 添加属性
        /// </summary>
        /// <returns></returns>
        public int AddAppendProperty(Base_AppendProperty info)
        {
            try
            {
                //using (Sam_DBEntities db = new Sam_DBEntities())
                //{
                //    db.Base_AppendProperty.Add(info);
                //    return db.SaveChanges();
                //}
                return append_dal.AddAppendProperty(info);
            }
            catch (Exception ex)
            {
                
                throw ex;
            }
        }
        /// <summary>
        /// 修改属性
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int UpdateAppendProertty(Base_AppendProperty info)
        {
            try
            {
                //using (Sam_DBEntities db = new Sam_DBEntities())
                //{
                //    db.Base_AppendProperty.Attach(info);
                //    db.Entry(info).State = System.Data.Entity.EntityState.Modified;
                //    return db.SaveChanges();
                //}
                return append_dal.UpdateAppendProertty(info);
            }
            catch (Exception ex)
            {
                
                throw ex;
            }
        }
        /// <summary>
        /// 删除属性
        /// </summary>
        /// <param name="Property_ID"></param>
        /// <returns></returns>
        public int DeleteAppendProettty(string Property_ID)
        {
            try
            {
                //using (Sam_DBEntities db=new Sam_DBEntities())
                //{
                //    var obj = new Base_AppendProperty { Property_ID= Property_ID };
                //    db.Base_AppendProperty.Attach(obj);
                //    db.Base_AppendProperty.Remove(obj);
                //    return db.SaveChanges();
                //}
                return append_dal.DeleteAppendProettty(Property_ID);
            }
            catch (Exception ex)
            {
 
                throw ex;
            }
        }
    }
}