public TableData Query(EquipmentStatusLog entity)
        {
            var result = new TableData();
            var data   = _app.Find(EntityToExpression <EquipmentStatusLog> .GetExpressions(entity));

            GetData(data, result);
            result.count = data.Count();

            return(result);
        }
示例#2
0
 public string Upd(EquipmentStatusLog Table_entity)
 {
     try
     {
         _app.Upd(Table_entity);
     }
     catch (Exception ex)
     {
         Result.Status  = false;
         Result.Message = ex.Message;
     }
     return(JsonHelper.Instance.Serialize(Result));
 }
示例#3
0
        public string GetTemplate()
        {
            var result = new TableData();
            List <EquipmentStatusLog> listEquipmentStatusLog = new List <EquipmentStatusLog>();
            EquipmentStatusLog        entity = _app.FindSingle(u => u.Id > 0);

            if (entity != null)
            {
                listEquipmentStatusLog.Add(entity);
            }
            else
            {
                listEquipmentStatusLog.Add(new EquipmentStatusLog());
            }

            result.data  = listEquipmentStatusLog;
            result.count = listEquipmentStatusLog.Count;

            return(JsonHelper.Instance.Serialize(result));
        }
        public Response ImportIn(IFormFile excelfile)
        {
            Response result = new Infrastructure.Response();
            List <EquipmentStatusLog> exp = imp.ConvertToModel <EquipmentStatusLog>(excelfile);
            string sErrorMsg = "";

            for (int i = 0; i < exp.Count; i++)
            {
                try
                {
                    EquipmentStatusLog 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);
        }
示例#5
0
 public string Load(PageReq pageRequest, EquipmentStatusLog entity)
 {
     return(JsonHelper.Instance.Serialize(_app.Load(pageRequest, entity)));
 }
示例#6
0
 public string Export(EquipmentStatusLog entity)
 {
     return(JsonHelper.Instance.Serialize(_app.ExportData(entity)));
 }
 public void Upd(EquipmentStatusLog entity)
 {
     _app.Update(entity);
 }
 public void Ins(EquipmentStatusLog entity)
 {
     _app.Add(entity);
 }
 public TableData Load(PageReq pageRequest, EquipmentStatusLog entity)
 {
     return(_app.Load(pageRequest, entity));
 }
 public TableData ExportData(EquipmentStatusLog entity)
 {
     return(_app.ExportData(entity));
 }