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