/// <summary>
        /// 报表18:假期高速公路交通流量统计表——修改功能
        /// </summary>
        /// <returns></returns>
        public JsonResult UpdateHDayRoadSta(UHDayRoadStaViewModel args)
        {
            ReportFactory.Instance.log.WriteLog(OperationType.Update, Utility.GetReportNameByType(18), Utility.GetFormatDate(args.DataDate, null));

            return Json(ReportFactory.Instance.report18.Update(args));
        }
        /// <summary>
        /// 修改功能
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public CustomResult Update(UHDayRoadStaViewModel args)
        {
            using (DataSubmittedEntities db = new DataSubmittedEntities())
            {
                using (TransactionScope transaction = new TransactionScope())
                {
                    CustomResult pReturnValue = new CustomResult();
                    List<UpdateHDayRoadStaViewModel> list = args.DataInfo.Where(a => a.LineType != 0).ToList();
                    try
                    {
                        foreach (UpdateHDayRoadStaViewModel model in list)
                        {
                            var listHDayRoadSta = db.RP_HDayAADTSta.Where(a => a.CalcuTime == args.DataDate && a.LineType == model.LineType).ToList();
                            foreach (RP_HDayAADTSta hd in listHDayRoadSta)
                            {
                                //  hd.LineType = model.LineType;
                                hd.ExNat = model.ExNat;
                                hd.EnNat = model.EnNat;
                                hd.ExEqu = model.ExEqu;
                                hd.EnEqu = model.EnEqu;

                                //拥挤度-“拥挤度”=交通量(当量交通量)合计/设计交通量,保留四位小数;
                                if (hd.ExEqu != null && hd.EnEqu != null)
                                {
                                    HDayAADTViewModel model1 = new HDayAADTViewModel();
                                    model1.LineType = model.LineType;
                                    Nullable<double> crowDeg = double.Parse(string.Format("{0:0.0000}", (hd.ExEqu + hd.EnEqu) / model1.DeTra));
                                    hd.CrowDeg = crowDeg;
                                }
                                hd.SmaEx = model.SmaEx;
                                hd.SmaEn = model.SmaEn;
                                hd.MedEx = model.MedEx;
                                hd.MedEn = model.MedEn;
                                hd.LarEx = model.LarEx;
                                hd.LarEn = model.LarEn;
                                hd.HeaEx = model.HeaEx;
                                hd.HeaEn = model.HeaEn;
                                hd.SupEx = model.SupEx;
                                hd.SupEn = model.SupEn;
                                hd.EnExTrukNum = model.EnExTrukNum;

                                //客车货车比例-客车货车比例=(交通量(自然交通量)合计-进出京货车数量)/进出京货车数量*100%,保留四位小数;
                                if (hd.ExNat != null && hd.EnNat != null && hd.EnExTrukNum != null && hd.EnExTrukNum != null)
                                {
                                    if (hd.EnExTrukNum != 0)
                                    {
                                        Nullable<double> carTrukPer = double.Parse(string.Format("{0:0.0000}", (hd.ExNat.Value + hd.EnNat.Value - hd.EnExTrukNum.Value) / hd.EnExTrukNum.Value));
                                        hd.CarTrukPer = carTrukPer;
                                    }
                                    else
                                    {
                                        hd.CarTrukPer = 0;
                                    }
                                }

                                //进出京大货车以上车型数量-进出京大货车以上车型数量”=大型车(合计)+重型车(合计)+超大型车(合计)。
                                if (hd.LarEx != null && hd.LarEn != null && hd.HeaEx != null && hd.HeaEn != null && hd.SupEx != null && hd.SupEn != null)
                                {
                                    Nullable<double> supTruNum = hd.LarEx.Value + hd.LarEn.Value + hd.HeaEx.Value + hd.HeaEn.Value + hd.SupEx.Value + hd.SupEn.Value;
                                    hd.SupTruNum = supTruNum;
                                }
                                //大货车以上占货车交通量比例-大货车以上占货车交通量比例(%)=进出京大货车以上车型的数量/进出京货车数量*100%,保留四位小数。
                                if (hd.SupTruNum != null && hd.EnExTrukNum != null)
                                {
                                    if (hd.EnExTrukNum.Value != 0)
                                    {
                                        Nullable<double> supTruPer = double.Parse(string.Format("{0:0.0000}", hd.SupTruNum.Value / hd.EnExTrukNum.Value));
                                        hd.SupTruPer = supTruPer;
                                    }
                                    else
                                    {
                                        hd.SupTruPer = 0;
                                    }
                                }
                                hd.UpdDate = DateTime.Now;
                                hd.State = "1";
                                if (SessionManage.GetLoginUser() != null)
                                {
                                    hd.UpdBy = SessionManage.GetLoginUser().UserName;
                                }
                            }
                            db.SaveChanges();
                        }

                        transaction.Complete();
                        pReturnValue.ResultKey = (byte)EResult.Succeed;
                        pReturnValue.ResultValue = TipInfo.UpdateSuccess;
                        return pReturnValue;
                    }
                    catch (Exception ex)
                    {
                        Common.SystemLog.GetInstance().Log.Info(TipInfo.UpdateDataRepeat, ex);
                        pReturnValue.ResultKey = (byte)EResult.Fail;
                        pReturnValue.ResultValue = TipInfo.UpdateDataRepeat;
                        return pReturnValue;
                    }
                }
            }
        }