/// <summary>
 /// 报表13修改
 /// </summary>
 /// <returns></returns>
 public JsonResult UpdateRoadStaExEnHour(UpdateHourAADTViewModel args)
 {
     ReportFactory.Instance.log.WriteLog(OperationType.Update, Utility.GetReportNameByType(13), Utility.GetFormatDate(args.DataDate, null));
     return Json(ReportFactory.Instance.report13.Update(args));
 }
 /// <summary>
 /// 批量修改
 /// </summary>
 /// <param name="args"></param>
 /// <returns></returns>
 public CustomResult Update(UpdateHourAADTViewModel args)
 {
     CustomResult pReturnValue = new CustomResult();
     pReturnValue.ResultKey = (byte)EResult.Fail;
     pReturnValue.ResultValue = TipInfo.UpdateFaile;
     if (args.UpdateData == null)
     {
         pReturnValue.ResultKey = (byte)EResult.Succeed;
         pReturnValue.ResultValue = TipInfo.DataNull;
         return pReturnValue;
     }
     using (DataSubmittedEntities db = new DataSubmittedEntities())
     {
         var pReportData = db.RP_HourAADT.Where(s => s.CalcuTime == args.DataDate && s.HourPer != 24).ToList();
         using (TransactionScope transaction = new TransactionScope())
         {
             try
             {
                 //获取对应的数据                      
                 foreach (UpdateHourAADTInfo item in args.UpdateData)
                 {
                     for (int i = 0; i < 24; i++)
                     {
                         RP_HourAADT pHourAADT = null;
                         List<RP_HourAADT> pHourList = pReportData.Where(s => s.HourPer == i).ToList();
                         if (pHourList.Count > 0)
                         {
                             pHourAADT = pHourList.SingleOrDefault();
                         }
                         else
                         {
                             //如果该时段的数据没有找到,则进行下次循环
                             continue;
                         }
                         Type myType = item.GetType();
                         PropertyInfo pinfo = myType.GetProperty("Count_" + i);
                         if (item.StaName == "大羊坊站" && item.TraName == "出京入")
                         {
                             pHourAADT.Dyf_ExIn = (double)pinfo.GetValue(item);
                         }
                         if (item.StaName == "马驹桥东站" && item.TraName == "进京入")
                         {
                             pHourAADT.Mjqd_EnIn = (double)pinfo.GetValue(item);
                         }
                         if (item.StaName == "马驹桥西站" && item.TraName == "出京入")
                         {
                             pHourAADT.Mjqx_ExIn = (double)pinfo.GetValue(item);
                         }
                         if (item.StaName == "采育站" && item.TraName == "出京入")
                         {
                             pHourAADT.Cy_ExIn = (double)pinfo.GetValue(item);
                         }
                         if (item.StaName == "大羊坊站" && item.TraName == "进京出")
                         {
                             pHourAADT.Dyf_EnOut = (double)pinfo.GetValue(item);
                         }
                         if (item.StaName == "马驹桥东站" && item.TraName == "进京出")
                         {
                             pHourAADT.Mjqd_EnOut = (double)pinfo.GetValue(item);
                         }
                         if (item.StaName == "马驹桥西站" && item.TraName == "进京出")
                         {
                             pHourAADT.Mjqx_EnOut = (double)pinfo.GetValue(item);
                         }
                         if (item.StaName == "采育站" && item.TraName == "进京出")
                         {
                             pHourAADT.Cy_EnOut = (double)pinfo.GetValue(item);
                         }
                         pHourAADT.UpdDate = DateTime.Now;
                         pHourAADT.State = "1";
                         if (SessionManage.GetLoginUser() != null)
                         {
                             pHourAADT.UpdBy = SessionManage.GetLoginUser().UserName;
                         }
                     }
                 }
                 db.SaveChanges();
                 transaction.Complete();
                 pReturnValue.ResultKey = (byte)EResult.Succeed;
                 pReturnValue.ResultValue = TipInfo.UpdateSuccess;
             }
             catch (Exception ex)
             {
                 Common.SystemLog.GetInstance().Log.Info(TipInfo.UpdateDataRepeat, ex);
                 pReturnValue.ResultKey = (byte)EResult.Fail;
                 pReturnValue.ResultValue = TipInfo.UpdateDataRepeat;
             }
             return pReturnValue;
         }
     }
 }