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