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