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 GetAppendPropertys() { try { return append_dal.GetAppendPropertys(); } catch (Exception ex) { throw ex; } } //具体业务功能属性列表 public List 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; } } /// /// 根据业务名称获取附加属性值 /// /// 所属功能 /// 业务主键 /// public List 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; } } /// /// 添加属性 /// /// 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; } } /// /// 修改属性 /// /// /// 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; } } /// /// 删除属性 /// /// /// 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; } } } }