/// <summary> /// 根据关键字段的值获取记录 /// </summary> /// <param name="Id">关键字段的值</param> /// <returns>符合查询条件的记录</returns> public PmTaskMaster GetPmTaskMasterById(string Id) { using (IPmTaskMasterBLL PmTaskMasterBLL = BLLContainer.Resolve <IPmTaskMasterBLL>()) { PmTaskMaster model = PmTaskMasterBLL.GetFirstOrDefault(Id); return(model); } }
/// <summary> /// 按照关键字段删除 /// </summary> /// <param name="Id">关键字段</param> /// <returns>是否成功</returns> public bool DelPmTaskMaster(string Id) { using (IPmTaskMasterBLL PmTaskMasterBLL = BLLContainer.Resolve <IPmTaskMasterBLL>()) { try { PmTaskMaster item = PmTaskMasterBLL.GetFirstOrDefault(Id); return(PmTaskMasterBLL.Delete(item)); } catch { return(false); } } }
/// <summary> /// 按照关键字段删除 /// </summary> /// <param name="Ids">关键字段数组</param> /// <returns>是否成功</returns> public bool DelPmTaskMasters(string[] Ids) { using (IPmTaskMasterBLL PmTaskMasterBLL = BLLContainer.Resolve <IPmTaskMasterBLL>()) { try { List <PmTaskMaster> entitys = new List <PmTaskMaster>(); foreach (string id in Ids) { PmTaskMaster item = PmTaskMasterBLL.GetFirstOrDefault(id); entitys.Add(item); } return(PmTaskMasterBLL.Delete(entitys)); } catch { return(false); } } }