public TableData Query(MaterialCallDetail entity) { var result = new TableData(); var data = _app.Find(EntityToExpression <MaterialCallDetail> .GetExpressions(entity)); GetData(data, result); result.count = data.Count(); return(result); }
public string Upd(MaterialCallDetail 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 <MaterialCallDetail> listMaterialCallDetail = new List <MaterialCallDetail>(); MaterialCallDetail entity = _app.FindSingle(u => u.Id > 0); if (entity != null) { listMaterialCallDetail.Add(entity); } else { listMaterialCallDetail.Add(new MaterialCallDetail()); } result.data = listMaterialCallDetail; result.count = listMaterialCallDetail.Count; return(JsonHelper.Instance.Serialize(result)); }
public Response ImportIn(IFormFile excelfile) { Response result = new Infrastructure.Response(); List <MaterialCallDetail> exp = imp.ConvertToModel <MaterialCallDetail>(excelfile); string sErrorMsg = ""; for (int i = 0; i < exp.Count; i++) { try { MaterialCallDetail 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 void Upd(MaterialCallDetail entity) { _app.Update(entity); }
public void Ins(MaterialCallDetail entity) { _app.Add(entity); }
public TableData Load(PageReq pageRequest, MaterialCallDetail entity) { return(_app.Load(pageRequest, entity)); }
public TableData ExportData(MaterialCallDetail entity) { return(_app.ExportData(entity)); }
public string Load(PageReq pageRequest, MaterialCallDetail entity) { return(JsonHelper.Instance.Serialize(_app.Load(pageRequest, entity))); }
public string Export(MaterialCallDetail entity) { return(JsonHelper.Instance.Serialize(_app.ExportData(entity))); }