Exemple #1
0
 /// <summary>
 /// 根据关键字段的值获取记录
 /// </summary>
 /// <param name="Id">关键字段的值</param>
 /// <returns>符合查询条件的记录</returns>
 public SysEnumItems GetSysEnumItemsById(string Id)
 {
     using (ISysEnumItemsBLL SysEnumItemsBLL = BLLContainer.Resolve <ISysEnumItemsBLL>())
     {
         SysEnumItems model = SysEnumItemsBLL.GetFirstOrDefault(Id);
         return(model);
     }
 }
Exemple #2
0
 /// <summary>
 /// 按照关键字段删除
 /// </summary>
 /// <param name="Id">关键字段</param>
 /// <returns>是否成功</returns>
 public bool DelSysEnumItems(string Id)
 {
     using (ISysEnumItemsBLL SysEnumItemsBLL = BLLContainer.Resolve <ISysEnumItemsBLL>())
     {
         try
         {
             SysEnumItems item = SysEnumItemsBLL.GetFirstOrDefault(Id);
             return(SysEnumItemsBLL.Delete(item));
         }
         catch { return(false); }
     }
 }
Exemple #3
0
 /// <summary>
 /// 按照关键字段删除
 /// </summary>
 /// <param name="Ids">关键字段数组</param>
 /// <returns>是否成功</returns>
 public bool DelSysEnumItemss(string[] Ids)
 {
     using (ISysEnumItemsBLL SysEnumItemsBLL = BLLContainer.Resolve <ISysEnumItemsBLL>())
     {
         try
         {
             List <SysEnumItems> entitys = new List <SysEnumItems>();
             foreach (string id in Ids)
             {
                 SysEnumItems item = SysEnumItemsBLL.GetFirstOrDefault(id);
                 entitys.Add(item);
             }
             return(SysEnumItemsBLL.Delete(entitys));
         }
         catch { return(false); }
     }
 }