Beispiel #1
0
        /// <summary>
        /// 查询车场收入数据
        /// </summary>
        /// <returns></returns>
        public JsonResult Get_HomeData()
        {
            JsonResult json = new JsonResult();

            json.Data = StatisticsServices.GetHomeData(GetLoginUserVillages.Select(p => p.VID).ToList());
            return(json);
        }
Beispiel #2
0
        /// <summary>
        /// 查询车场收入数据
        /// </summary>
        /// <returns></returns>
        public JsonResult Search_InCome()
        {
            string     parkingid = Request.Params["parkingid"];
            JsonResult json      = new JsonResult();

            json.Data = StatisticsServices.Analysis_InCome(parkingid);
            return(json);
        }
 public HomeController(ILogger <HomeController> logger,
                       AccountsService customerServices,
                       StatisticsServices statisticsServices)
 {
     _logger = logger;
     this.customerServices   = customerServices;
     this.statisticsServices = statisticsServices;
 }
Beispiel #4
0
 public StatisticsController(StatisticsServices statisticsServices,
                             CustomerService customerServices,
                             MetaDataService metaDataServices,
                             UserManager <IdentityUser> userManager,
                             ILogger <StatisticsController> logger)
 {
     this.statisticsService = statisticsServices;
     this.customerService   = customerServices;
     this.metaDataService   = metaDataServices;
     this.userManager       = userManager;
     this.logger            = logger;
 }
Beispiel #5
0
        public ActionResult GetInOutRecordData()
        {
            try
            {
                int      page  = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int      rows  = 15;
                InParams paras = new InParams
                {
                    ParkingID   = Request.Params["parkingid"],
                    CardType    = Request.Params["cardtypeid"],
                    CarType     = Request.Params["cartypeid"],
                    OutGateID   = "-1",
                    InGateID    = "-1",
                    OutOperator = Request.Params["exitoperatorid"],
                    ReleaseType = int.Parse(Request.Params["releasetype"]),
                    AreaID      = "-1",
                    StartTime   = DateTime.Parse(Request.Params["starttime"]),
                    EndTime     = DateTime.Parse(Request.Params["endtime"]),
                    IsExit      = int.Parse(Request.Params["isexit"]),
                    PlateNumber = Request.Params["platenumber"],
                    Owner       = Request.Params["owner"],
                    ReportType  = ReportType.InOut
                };

                Pagination pagination = StatisticsServices.Search_InOutRecords(paras, rows, page);
                var        result     = from p in pagination.IORecordsList
                                        select new
                {
                    PKName          = p.PKName,
                    PlateNumber     = p.PlateNumber,
                    CarTypeName     = p.CarTypeName,
                    InGateName      = p.InGateName,
                    AreaName        = p.AreaName,
                    EntranceTime    = p.EntranceTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    LongTime        = p.LongTime,
                    EmployeeName    = string.IsNullOrWhiteSpace(p.EmployeeName) ? "" : p.EmployeeName,
                    MobilePhone     = string.IsNullOrWhiteSpace(p.MobilePhone) ? "" : p.MobilePhone,
                    InOperatorName  = p.InOperatorName,
                    IsExit          = p.IsExit ? "已出场" : "在场",
                    CarModelName    = p.CarModelName,
                    ReleaseTypeName = p.ReleaseTypeName,
                    ExitTime        = p.IsExit ? p.ExitTime.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty,
                    OutGateName     = string.IsNullOrWhiteSpace(p.OutGateName) ? "" : p.OutGateName,
                };
                return(Json(MyResult.Success("", result)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "微信管理端获取进出记录失败");
                return(Json(MyResult.Error("获取失败")));
            }
        }
Beispiel #6
0
        public ActionResult GetParkPaymentRecordData()
        {
            try
            {
                int      page  = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int      rows  = 15;
                InParams paras = new InParams
                {
                    ParkingID     = Request.Params["parkingid"],
                    OnLineOffLine = int.Parse(Request.Params["onlineoffline"]),
                    OrderSource   = int.Parse(Request.Params["ordersource"]),
                    StartTime     = DateTime.Parse(Request.Params["starttime"]),
                    EndTime       = DateTime.Parse(Request.Params["endtime"]),
                    BoxID         = Request.Params["boxid"],
                    PlateNumber   = Request.Params["platenumber"],
                    OutOperator   = Request.Params["exitoperatorid"],
                    ReleaseType   = -1,
                    ReportType    = ReportType.TempPay
                };

                Pagination pagination = StatisticsServices.Search_TempPays(paras, rows, page);
                var        result     = from p in pagination.OrderList
                                        select new
                {
                    PKName          = p.PKName,
                    PlateNumber     = p.PlateNumber,
                    OrderNo         = p.OrderNo,
                    Amount          = p.Amount,
                    PayAmount       = p.PayAmount,
                    UnPayAmount     = p.UnPayAmount,
                    DiscountAmount  = p.DiscountAmount.ToString(),
                    OrderTime       = p.OrderTime != DateTime.MinValue ? p.OrderTime.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty,
                    EntranceTime    = p.EntranceTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    LongTime        = p.LongTime,
                    PayWayName      = p.PayWayName,
                    OrderSourceName = p.OrderSourceName,
                    Operator        = string.IsNullOrWhiteSpace(p.Operator) ? string.Empty : p.Operator,
                    ExitTime        = p.ExitTime.ToString("yyyy-MM-dd HH:mm:ss")
                };
                return(Json(MyResult.Success("", result)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "微信管理端获取停车缴费记录失败");
                return(Json(MyResult.Error("获取失败")));
            }
        }
Beispiel #7
0
        /// <summary>
        /// 获取异常放行数据
        /// </summary>
        /// <returns></returns>
        public ActionResult GetExceptionReleaseData()
        {
            try
            {
                int      page  = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int      rows  = 15;
                InParams paras = new InParams
                {
                    ParkingID   = Request.Params["parkingid"],
                    PlateNumber = Request.Params["platenumber"],
                    OutGateID   = Request.Params["exitgateid"],
                    StartTime   = DateTime.Parse(Request.Params["starttime"]),
                    EndTime     = DateTime.Parse(Request.Params["endtime"]),
                    ReportType  = ReportType.ExceptionRelease
                };

                Pagination pagination = StatisticsServices.Search_ExceptionRelease(paras, rows, page);
                var        result     = from p in pagination.IORecordsList
                                        select new
                {
                    PKName          = p.PKName,
                    PlateNumber     = p.PlateNumber.Contains("无车牌") ? "无车牌" : p.PlateNumber,
                    CarTypeName     = p.CarTypeName,
                    InGateName      = p.InGateName,
                    AreaName        = p.AreaName,
                    EntranceTime    = p.EntranceTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    EmployeeName    = string.IsNullOrWhiteSpace(p.EmployeeName) ? "" : p.EmployeeName,
                    MobilePhone     = string.IsNullOrWhiteSpace(p.MobilePhone) ? "" : p.MobilePhone,
                    InOperatorName  = p.InOperatorName,
                    CarModelName    = p.CarModelName,
                    ReleaseTypeName = p.ReleaseTypeName,
                    ExitTime        = p.IsExit ? p.ExitTime.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty,
                    OutGateName     = string.IsNullOrWhiteSpace(p.OutGateName) ? "" : p.OutGateName,
                    Remark          = p.Remark
                };
                return(Json(MyResult.Success("", pagination.IORecordsList)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "微信管理端获取异常放行数据失败");
                return(Json(MyResult.Error("获取失败")));
            }
        }
Beispiel #8
0
        public ActionResult PingjiaTongji(int babyid)
        {
            if (Session["CustomerId"] != null)
            {
                AdsBaby baby = unitOfWork.adsBabysRepository.GetByID(babyid);

                ViewBag.pingjiaA = StatisticsServices.GetPingjiaCountByBabyId(baby.BabyId, 0.3f);
                ViewBag.pingjiaB = StatisticsServices.GetPingjiaCountByBabyId(baby.BabyId, 0.5f);
                ViewBag.pingjiaC = StatisticsServices.GetPingjiaCountByBabyId(baby.BabyId, 0.8f);
                ViewBag.babyId   = baby.BabyId;
                ViewBag.babyName = baby.BabyName;

                string A1 = "", B1 = "", C1 = "", catName = "";


                //这里需要循环Category
                List <Category> listcat = CategoryServices.GetCategoryListByParentID(3);

                foreach (Category cat in listcat)
                {
                    catName = catName + "'" + cat.CategoryName + "'" + ",";

                    A1 = A1 + unitOfWork.pingjiasRepository.Get(filter: u => u.VideoCategory == cat.ID && u.BabyId == babyid && u.PingjiaValue == 0.3f).Count().ToString() + ",";
                    B1 = B1 + unitOfWork.pingjiasRepository.Get(filter: u => u.VideoCategory == cat.ID && u.BabyId == babyid && u.PingjiaValue == 0.5f).Count().ToString() + ",";
                    C1 = C1 + unitOfWork.pingjiasRepository.Get(filter: u => u.VideoCategory == cat.ID && u.BabyId == babyid && u.PingjiaValue == 0.8f).Count().ToString() + ",";
                }
                catName = catName.TrimEnd(',');
                A1      = A1.TrimEnd(',');
                B1      = B1.TrimEnd(',');
                C1      = C1.TrimEnd(',');

                ViewBag.A       = A1;
                ViewBag.B       = B1;
                ViewBag.C       = C1;
                ViewBag.catName = catName;

                return(View());
            }
            else
            {
                return(RedirectToAction("Login"));
            }
        }
Beispiel #9
0
        public JsonResult GetDayGatherData()
        {
            try
            {
                int      page  = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int      rows  = 15;
                InParams paras = new InParams
                {
                    ParkingID = Request.Params["parkingid"],
                    StartTime = DateTime.Parse(Request.Params["starttime"] + " 00:00:00"),
                    EndTime   = DateTime.Parse(Request.Params["endtime"] + " 23:59:59")
                };

                Pagination pagination = StatisticsServices.Search_DailyStatistics(paras, rows, page);
                var        result     = from p in pagination.StatisticsGatherList
                                        select new
                {
                    ParkingName                 = p.ParkingName,
                    KeyName                     = p.KeyName,
                    Receivable_Amount           = p.Receivable_Amount,
                    Real_Amount                 = p.Real_Amount,
                    Diff_Amount                 = p.Diff_Amount,
                    Entrance_Count              = p.Entrance_Count,
                    Exit_Count                  = p.Exit_Count,
                    ReleaseType_Normal          = p.ReleaseType_Normal,
                    ReleaseType_Charge          = p.ReleaseType_Charge,
                    ReleaseType_Free            = p.ReleaseType_Free,
                    ReleaseType_Catch           = p.ReleaseType_Catch,
                    VIPExtend_Count             = p.VIPExtend_Count,
                    OnLineMonthCardExtend_Count = p.OnLineMonthCardExtend_Count,
                    MonthCardExtend_Count       = p.MonthCardExtend_Count,
                    OnLineStordCard_Count       = p.OnLineStordCard_Count,
                    StordCardRecharge_Count     = p.StordCardRecharge_Count
                };
                return(Json(MyResult.Success("", result)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "微信管理端获取日汇总失败");
                return(Json(MyResult.Error("获取失败")));
            }
        }
Beispiel #10
0
        public ActionResult GetPresentCarData()
        {
            try
            {
                int page = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int rows = 15;

                InParams paras = new InParams
                {
                    ParkingID   = Request.Params["parkingid"],
                    PlateNumber = Request.Params["platenumber"],
                    StartTime   = DateTime.Parse(Request.Params["starttime"]),
                    EndTime     = DateTime.Parse(Request.Params["endtime"]),
                    ReportType  = ReportType.Presence,
                    CardType    = "-1",
                    InGateID    = "-1"
                };

                Pagination pagination = StatisticsServices.Search_Presence(paras, rows, page);
                var        result     = from p in pagination.IORecordsList
                                        select new
                {
                    PKName         = p.PKName,
                    PlateNumber    = p.PlateNumber,
                    CarTypeName    = p.CarTypeName,
                    InGateName     = p.InGateName,
                    AreaName       = p.AreaName,
                    EntranceTime   = p.EntranceTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    LongTime       = p.LongTime,
                    EmployeeName   = string.IsNullOrWhiteSpace(p.EmployeeName) ? "" : p.EmployeeName,
                    MobilePhone    = string.IsNullOrWhiteSpace(p.MobilePhone) ? "" : p.MobilePhone,
                    InOperatorName = p.InOperatorName
                };
                return(Json(MyResult.Success("", result)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "微信管理端获取在场车辆失败");
                return(Json(MyResult.Error("获取失败")));
            }
        }
Beispiel #11
0
        public ActionResult GetMonthGatherData()
        {
            try
            {
                int      page  = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int      rows  = 15;
                InParams paras = new InParams
                {
                    ParkingID = Request.Params["parkingid"],
                    StartTime = DateTime.Parse(Request.Params["starttime"] + "-01 00:00:00"),
                    EndTime   = DateTime.Parse(Request.Params["endtime"] + "-01 00:00:00").AddSeconds(-1).AddMonths(1)
                };

                Pagination pagination = StatisticsServices.Search_MonthStatistics(paras, rows, page);
                return(Json(MyResult.Success("", pagination.StatisticsGatherList)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "微信管理端获取月汇总失败");
                return(Json(MyResult.Error("获取失败")));
            }
        }
Beispiel #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            InParams            paras        = (InParams)System.Web.HttpContext.Current.Session["QueryParams"];
            List <ParkIORecord> iorecordlist = new List <ParkIORecord> ();

            if (paras != null)
            {
                switch (paras.ReportType)
                {
                //在场车辆
                case ReportType.Presence:
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_Presence(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            iorecordlist = v.IORecordsList;
                        }
                    }
                    else
                    {
                        iorecordlist = StatisticsServices.Search_Presence(paras);
                    }
                    EmptyTransfer(iorecordlist);
                    rdocument.Load(Server.MapPath(RptPresence));
                    rdocument.SetDataSource(iorecordlist);
                    break;

                //在场无牌车辆
                case ReportType.NoPlateNumber:
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_NoPlateNumber(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            iorecordlist = v.IORecordsList;
                        }
                    }
                    else
                    {
                        iorecordlist = StatisticsServices.Search_NoPlateNumber(paras);
                    }
                    EmptyTransfer(iorecordlist);
                    rdocument.Load(Server.MapPath(RptNoPlateNumber));
                    rdocument.SetDataSource(iorecordlist);
                    break;

                //进出记录
                case ReportType.InOut:
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_InOutRecords(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            iorecordlist = v.IORecordsList;
                        }
                    }
                    else
                    {
                        iorecordlist = StatisticsServices.Search_InOutRecords(paras);
                    }
                    EmptyTransfer(iorecordlist);
                    rdocument.Load(Server.MapPath(RptInOut));
                    rdocument.SetDataSource(iorecordlist);
                    break;

                //异常放行
                case ReportType.ExceptionRelease:
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_ExceptionRelease(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            iorecordlist = v.IORecordsList;
                        }
                    }
                    else
                    {
                        iorecordlist = StatisticsServices.Search_ExceptionRelease(paras);
                    }
                    EmptyTransfer(iorecordlist);
                    rdocument.Load(Server.MapPath(RptExceptionRelease));
                    rdocument.SetDataSource(iorecordlist);
                    break;

                //通道事件
                case ReportType.GateEvent:
                    List <ParkEvent> parkeventlist = new List <ParkEvent> ();
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_GateEvents(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            parkeventlist = v.GateEventList;
                        }
                    }
                    else
                    {
                        parkeventlist = StatisticsServices.Search_GateEvents(paras);
                    }
                    rdocument.Load(Server.MapPath(RptGateEvent));
                    rdocument.SetDataSource(EmptyTransferEvent(parkeventlist));
                    break;

                //当班统计
                case ReportType.OnDuty:
                    List <Statistics_ChangeShift> changeshiftlist = new System.Collections.Generic.List <Statistics_ChangeShift> ();
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_OnDuty(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            changeshiftlist = v.OnDutyList;
                        }
                    }
                    else
                    {
                        changeshiftlist = StatisticsServices.Search_OnDuty(paras);
                    }
                    rdocument.Load(Server.MapPath(RptOnDuty));
                    rdocument.SetDataSource(changeshiftlist);
                    break;

                //订单明细
                case ReportType.Order:
                    List <ParkOrder> parkorderlist = new List <ParkOrder> ();
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_Orders(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            parkorderlist = v.OrderList;
                        }
                    }
                    else
                    {
                        parkorderlist = StatisticsServices.Search_Orders(paras);
                    }
                    rdocument.Load(Server.MapPath(RptOrder));
                    rdocument.SetDataSource(EmptyTransferOrder(parkorderlist));
                    break;

                //月卡续期
                case ReportType.CardExtension:
                    List <ParkOrder> cardextensionorderlist = new List <ParkOrder> ();
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_CardExtension(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            cardextensionorderlist = v.OrderList;
                        }
                    }
                    else
                    {
                        cardextensionorderlist = StatisticsServices.Search_CardExtension(paras);
                    }
                    rdocument.Load(Server.MapPath(RptCardExtension));
                    rdocument.SetDataSource(EmptyTransferOrder(cardextensionorderlist));
                    break;

                //临停缴费
                case ReportType.TempPay:
                    List <ParkOrder> temppayorderlist = new List <ParkOrder> ();
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_TempPays(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            temppayorderlist = v.OrderList;
                        }
                    }
                    else
                    {
                        temppayorderlist = StatisticsServices.Search_TempPays(paras);
                    }
                    rdocument.Load(Server.MapPath(RptTempPay));
                    rdocument.SetDataSource(EmptyTransferOrder(temppayorderlist));
                    break;

                //商家优免
                case ReportType.Coupon:
                    List <ParkCarDerate> parkcarderatelist = new List <ParkCarDerate> ();
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_CarDerates(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            parkcarderatelist = v.CarDerateList;
                        }
                    }
                    else
                    {
                        parkcarderatelist = StatisticsServices.Search_CarDerates(paras);
                    }
                    EmptyTransferCarDerate(parkcarderatelist);
                    rdocument.Load(Server.MapPath(RptCoupon));
                    rdocument.SetDataSource(parkcarderatelist);
                    break;

                //日报表
                case ReportType.DailyFee:
                    List <Statistics_Gather> dailystatisticslist = new List <Statistics_Gather> ();
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_DailyStatistics(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            dailystatisticslist = v.StatisticsGatherList;
                        }
                    }
                    else
                    {
                        dailystatisticslist = StatisticsServices.Search_DailyStatistics(paras);
                    }
                    rdocument.Load(Server.MapPath(RptStatisticsDaily));
                    rdocument.SetDataSource(dailystatisticslist);
                    break;

                //月报表
                case ReportType.MonthFee:
                    List <Statistics_Gather> monthstatisticslist = new List <Statistics_Gather> ();
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_MonthStatistics(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            monthstatisticslist = v.StatisticsGatherList;
                        }
                    }
                    else
                    {
                        monthstatisticslist = StatisticsServices.Search_MonthStatistics(paras);
                    }
                    rdocument.Load(Server.MapPath(RptStatisticsMonth));
                    rdocument.SetDataSource(monthstatisticslist);
                    break;

                //日汇总报表
                case ReportType.DailyGather:
                    List <Statistics_Gather> dailystatisticsgatherlist = new List <Statistics_Gather> ();
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_DailyStatistics(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            dailystatisticsgatherlist = v.StatisticsGatherList;
                        }
                    }
                    else
                    {
                        dailystatisticsgatherlist = StatisticsServices.Search_DailyStatistics(paras);
                    }
                    rdocument.Load(Server.MapPath(RptStatisticsDailyGather));
                    rdocument.SetDataSource(dailystatisticsgatherlist);
                    break;

                //月汇总报表
                case ReportType.MonthGather:
                    List <Statistics_Gather> monthstatisticsgatherlist = new List <Statistics_Gather> ();
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_MonthStatistics(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            monthstatisticsgatherlist = v.StatisticsGatherList;
                        }
                    }
                    else
                    {
                        monthstatisticsgatherlist = StatisticsServices.Search_MonthStatistics(paras);
                    }
                    rdocument.Load(Server.MapPath(RptStatisticsMonthGather));
                    rdocument.SetDataSource(monthstatisticsgatherlist);
                    break;

                //月卡信息
                case ReportType.MonthCardInfo:
                    List <MonthCardInfoModel> monthcardinfolist = new List <MonthCardInfoModel>();
                    if (paras.PageIndex > 0)
                    {
                        var v = StatisticsServices.Search_MonthCardInfo(paras, paras.PageSize, paras.PageIndex);
                        if (v != null)
                        {
                            monthcardinfolist = v.MonthCardList;
                        }
                    }
                    else
                    {
                        monthcardinfolist = StatisticsServices.Search_MonthCardInfo(paras);
                    }
                    EmptyTransfer(monthcardinfolist);
                    rdocument.Load(Server.MapPath(RptMonthCardInfo));
                    rdocument.SetDataSource(monthcardinfolist);
                    break;

                //访客信息
                case ReportType.ParkVisitorInfo:
                    List <ParkVisitorReportModel> models    = new List <ParkVisitorReportModel>();
                    VisitorReportCondition        condition = (VisitorReportCondition)System.Web.HttpContext.Current.Session["VisitorReportCondition"];
                    int        pageIndex = paras.PageIndex < 0 ? 1 : paras.PageIndex;
                    int        pageSize  = paras.PageIndex < 0 ? int.MaxValue : paras.PageSize;
                    Pagination result    = StatisticsServices.QueryParkVisitorReport(condition, pageSize, pageIndex);
                    if (result != null)
                    {
                        models = result.VisitorList;
                        foreach (var item in models)
                        {
                            if (string.IsNullOrWhiteSpace(item.VisitorName))
                            {
                                item.VisitorName = "-";
                            }
                        }
                    }

                    rdocument.Load(Server.MapPath(RptParkVisitorInfo));
                    rdocument.SetDataSource(models);
                    break;

                default:
                    break;
                }
            }
            this.StatisticsReportViewer1.ReportSource = rdocument;
            this.StatisticsReportViewer1.DataBind();
        }
Beispiel #13
0
        public ActionResult Calendar(int?page, int?cid, int?orderid)
        {
            int oid = orderid ?? 1;

            AdsBaby baby = new AdsBaby();

            if (Session["CustomerId"] != null)
            {
                int id    = int.Parse(Session["CustomerId"].ToString());
                var babys = unitOfWork.adsBabysRepository.Get(filter: u => u.CustomerId == id && u.Babystatus == true);
                int count = babys.Count();
                if (count > 0)
                {
                    baby = babys.First() as AdsBaby;
                    ViewData["videocat"] = CategoryServices.GetCategoryListByParentID(2);
                    ViewBag.babyName     = baby.BabyName;
                    ViewBag.babyId       = baby.BabyId;
                    ViewBag.cepingcount  = StatisticsServices.GetCepingCountByBabyId(baby.BabyId);
                    ViewBag.pingjiacount = StatisticsServices.GetPingjiaCountByBabyId(baby.BabyId, 0);
                    ViewBag.days         = StatisticsServices.GetDaysByCustomerId(baby.BabyRegTime);

                    List <BaogaoDemention> demlist = PlanServices.PlanCategory(baby.BabyId);
                    if (demlist.Count() == 0)
                    {
                        return(RedirectToAction("NoScale", new { name = baby.BabyName }));
                    }

                    int categoryid = cid ?? demlist[0].demcategoryid;

                    Pager pager = new Pager();
                    pager.table      = "AdsVideo";
                    pager.strwhere   = "VideoCategory=" + categoryid;
                    pager.PageSize   = 15;
                    pager.PageNo     = page ?? 1;
                    pager.FieldKey   = "VideoId";
                    pager.FiledOrder = "VideoId desc";


                    pager = CommonDal.GetPager(pager);
                    IList <AdsVideo> videos = DataConvertHelper <AdsVideo> .ConvertToModel(pager.EntityDataTable);

                    var videosAsIPageList = new StaticPagedList <AdsVideo>(videos, pager.PageNo, pager.PageSize, pager.Amount);

                    ViewBag.orderid = oid;

                    if (oid == 1 || oid == 2)
                    {
                        ViewBag.ctitle    = "必修任务";
                        ViewBag.cminTitle = "每次需训练30分钟";
                    }
                    if (oid == 3 || oid == 4)
                    {
                        ViewBag.ctitle    = "选修任务";
                        ViewBag.cminTitle = "每次需训练20分钟";
                    }
                    if (oid == 5)
                    {
                        ViewBag.ctitle    = "一般任务";
                        ViewBag.cminTitle = "自行安排训练";
                    }
                    ViewData["dem"] = demlist;



                    return(View(videosAsIPageList));
                }
                else
                {
                    return(RedirectToAction("NoBaby"));
                }
            }
            else
            {
                return(RedirectToAction("Login"));
            }
        }