public DAAlarmRecord GetDAAlarmRecordById(string Id) { using (IDAAlarmRecordBLL DAAlarmRecordBLL = BLLContainer.Resolve <IDAAlarmRecordBLL>()) { DAAlarmRecord model = DAAlarmRecordBLL.GetFirstOrDefault(Id); return(model); } }
public int GetDAAlarmRecordCount(string sWhere) { Expression <Func <DAAlarmRecord, bool> > whereLamda = SerializerHelper.ConvertParamWhereToLinq <DAAlarmRecord>(sWhere); using (IDAAlarmRecordBLL DAAlarmRecordBLL = BLLContainer.Resolve <IDAAlarmRecordBLL>()) { return(DAAlarmRecordBLL.GetCount(whereLamda)); } }
public List <DAAlarmRecord> GetDAAlarmRecords([FromBody] string sWhere) { Expression <Func <DAAlarmRecord, bool> > whereLamda = SerializerHelper.ConvertParamWhereToLinq <DAAlarmRecord>(sWhere); using (IDAAlarmRecordBLL DAAlarmRecordBLL = BLLContainer.Resolve <IDAAlarmRecordBLL>()) { List <DAAlarmRecord> models = DAAlarmRecordBLL.GetModels(whereLamda); return(models); } }
public bool AddDAAlarmRecord(DAAlarmRecord mDAAlarmRecord) { if (mDAAlarmRecord == null) { return(false); } using (IDAAlarmRecordBLL DAAlarmRecordBLL = BLLContainer.Resolve <IDAAlarmRecordBLL>()) { return(DAAlarmRecordBLL.Add(mDAAlarmRecord)); } }
public bool DelDAAlarmRecord(string Id) { using (IDAAlarmRecordBLL DAAlarmRecordBLL = BLLContainer.Resolve <IDAAlarmRecordBLL>()) { try { DAAlarmRecord item = DAAlarmRecordBLL.GetFirstOrDefault(Id); return(DAAlarmRecordBLL.Delete(item)); } catch { return(false); } } }
public bool DelDAAlarmRecords(string[] Ids) { using (IDAAlarmRecordBLL DAAlarmRecordBLL = BLLContainer.Resolve <IDAAlarmRecordBLL>()) { try { List <DAAlarmRecord> entitys = new List <DAAlarmRecord>(); foreach (string id in Ids) { DAAlarmRecord item = DAAlarmRecordBLL.GetFirstOrDefault(id); entitys.Add(item); } return(DAAlarmRecordBLL.Delete(entitys)); } catch { return(false); } } }
public List <DAAlarmRecord> GetDAAlarmRecordByPage(int pageSize, int pageIndex, bool isAsc, string orderField, string sWhere) { string orderStr = ""; if (string.IsNullOrEmpty(orderField)) { orderStr = "CREATION_DATE"; } else { orderStr = orderField; } Expression <Func <DAAlarmRecord, bool> > whereLamda = SerializerHelper.ConvertParamWhereToLinq <DAAlarmRecord>(sWhere); using (IDAAlarmRecordBLL DAAlarmRecordBLL = BLLContainer.Resolve <IDAAlarmRecordBLL>()) { List <DAAlarmRecord> models = DAAlarmRecordBLL.GetModelsByPage(pageSize, pageIndex, isAsc, orderStr, whereLamda); return(models); } }