public TableData Query(InventoryAlert entity) { var result = new TableData(); var data = _app.Find(EntityToExpression <InventoryAlert> .GetExpressions(entity)); GetData(data, result); result.count = data.Count(); return(result); }
public string Upd(InventoryAlert Table_entity) { try { _app.Upd(Table_entity); } catch (Exception ex) { Result.Status = false; Result.Message = ex.Message; } return(JsonHelper.Instance.Serialize(Result)); }
public string GetTemplate() { var result = new TableData(); List <InventoryAlert> listInventoryAlert = new List <InventoryAlert>(); InventoryAlert entity = _app.FindSingle(u => u.Id > 0); if (entity != null) { listInventoryAlert.Add(entity); } else { listInventoryAlert.Add(new InventoryAlert()); } result.data = listInventoryAlert; result.count = listInventoryAlert.Count; return(JsonHelper.Instance.Serialize(result)); }
public Response ImportIn(IFormFile excelfile) { Response result = new Infrastructure.Response(); List <InventoryAlert> exp = imp.ConvertToModel <InventoryAlert>(excelfile); string sErrorMsg = ""; for (int i = 0; i < exp.Count; i++) { try { InventoryAlert e = exp[i]; e.Id = null; _app.Add(e); } catch (Exception ex) { sErrorMsg += "第" + (i + 2) + "行:" + ex.Message + "<br>"; result.Message = sErrorMsg; break; } } if (sErrorMsg.Equals(string.Empty)) { if (exp.Count == 0) { sErrorMsg += "没有发现有效数据, 请确定模板是否正确, 或是否有填充数据!"; result.Message = sErrorMsg; } else { result.Message = "导入完成"; } } else { result.Status = false; result.Message = result.Message; } return(result); }
public string Load(PageReq pageRequest, InventoryAlert entity) { return(JsonHelper.Instance.Serialize(_app.Load(pageRequest, entity))); }
public string Export(InventoryAlert entity) { return(JsonHelper.Instance.Serialize(_app.ExportData(entity))); }
public void Upd(InventoryAlert entity) { _app.Update(entity); }
public void Ins(InventoryAlert entity) { _app.Add(entity); }
public TableData Load(PageReq pageRequest, InventoryAlert entity) { return(_app.Load(pageRequest, entity)); }
public TableData ExportData(InventoryAlert entity) { return(_app.ExportData(entity)); }