Пример #1
0
 public int SaveImportEneryValue(ImportTemp import)
 {
     var cmd = new DataCommand("ImportData", new SqlCustomDbCommand());
     cmd.SetParameterValue("@ObjectID", import.ObjectId);
     cmd.SetParameterValue("@IsArea", import.IsArea);
     cmd.SetParameterValue("@StartTime", import.StartTime);
     cmd.SetParameterValue("@EndTime", import.EndTime);
     cmd.SetParameterValue("@ItemCode", import.ItemCode);
     cmd.SetParameterValue("@ImportValue", import.ImportValue);
     cmd.SetParameterValue("@MonthType", import.MonthType);
     cmd.SetParameterValue("@ExcelId", import.ExcelId);
     return cmd.ExecuteNonQuery();
 }
Пример #2
0
 public int SaveImportEneryValue(ImportTemp import)
 {
     return _import.SaveImportEneryValue(import);
 }
Пример #3
0
 public SaveResult SaveObjectEnery()
 {
     decimal temp;
     var inputValue = _ntsPage.Request.Form["Inputs"];
     var query = Newtonsoft.Json.JsonConvert.DeserializeObject<QueryEnery>(inputValue);
     query.ObjectId = query.IsArea == 1 ? query.ObjectId : query.DeviceId;
     if (!decimal.TryParse(query.ObjectValue.ToString(), out temp))
     {
         return new SaveResult {IsOK = false, MessageContent = "录入的能耗值的格式不正确。"};
     }
     var import = new ImportTemp()
     {
         ImportValue = temp,
         ExcelId = -1,
         StartTime = query.Starttime,
         EndTime = query.Starttime,
         IsArea = query.IsArea,
         ItemCode = query.ItemCode,
         ObjectId = query.ObjectId,
         MonthType = query.DateUnit
     };
     return _bll.SaveImportEneryValue(import) > 0
         ? new SaveResult {IsOK = true, MessageContent = "人工导入成功,等待后台服务进行处理。"}
         : new SaveResult {IsOK = false, MessageContent = "人工导入失败,请联系管理员。"};
 }