Example #1
0
        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));
        }
Example #4
0
        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);
        }
Example #5
0
 public void Upd(MaterialCallDetail entity)
 {
     _app.Update(entity);
 }
Example #6
0
 public void Ins(MaterialCallDetail entity)
 {
     _app.Add(entity);
 }
Example #7
0
 public TableData Load(PageReq pageRequest, MaterialCallDetail entity)
 {
     return(_app.Load(pageRequest, entity));
 }
Example #8
0
 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)));
 }