コード例 #1
0
        public ActionResult DailyStatisticsPage(string YearMonth, string DriverId, string CustomerId)
        {
            BookingReportMonthSearchModel model = new BookingReportMonthSearchModel();

            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Login", "Account"));
            }

            model.SearchYearMonth   = YearMonth;
            model.SearchDriverId    = DriverId;
            model.SearchGoodOwnerId = CustomerId;

            DateTime parsedYearMonth = DateTime.Parse(YearMonth);

            if (!string.IsNullOrEmpty(DriverId))
            {
                ViewBag.TitleChoose = "司機";
            }
            else if (!string.IsNullOrEmpty(CustomerId))
            {
                ViewBag.TitleChoose = "客戶";
            }

            ViewBag.SubTitle = " " + parsedYearMonth.Year + "年" + parsedYearMonth.Month + "月 每日趟次統計";

            //限制只能為自己的公司
            var user = _aspNetUsersService.GetUserModelByName(User.Identity.Name);

            CommonGoodsOwnerDriverVehicleDropdownList(user.CompanyId);

            return(View(model));
        }
コード例 #2
0
        /// <summary>
        /// 車輛任務列表
        /// </summary>
        /// <returns></returns>
        public ActionResult VehicleMissionList(string YearMonth, int VehicleId)
        {
            BookingReportMonthSearchModel model = new BookingReportMonthSearchModel();

            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Login", "Account"));
            }

            model.SearchYearMonth = YearMonth;
            Session["YearMonth"]  = YearMonth;
            model.SearchVehicleId = VehicleId;

            //限制只能為自己的公司
            var user = _aspNetUsersService.GetUserModelByName(User.Identity.Name);

            CommonGoodsOwnerDriverVehicleDropdownList(user.CompanyId);
            return(View(model));
        }
コード例 #3
0
        public JsonResult GetVehicleMissionReportList(BookingReportMonthSearchModel SearchViewModel)
        {
            ResponseViewModel result = new ResponseViewModel();

            DateTime parsedYearMonth = DateTime.Parse(SearchViewModel.SearchYearMonth);

            SearchViewModel.SearchYear  = parsedYearMonth.Year;
            SearchViewModel.SearchMonth = parsedYearMonth.Month;

            if (SessionMonthDailySearchModel != null)
            {
                if (SearchViewModel != SessionMonthDailySearchModel)
                {
                    SessionMonthDailySearchModel = SearchViewModel;
                }
                else
                {
                    SearchViewModel = SessionMonthDailySearchModel;
                }
            }

            try
            {
                result.Data           = _bookingService.GetVehicleMissionReportList(SearchViewModel);
                result.IsOk           = true;
                result.HttpStatusCode = HttpStatusCode.OK;
            }
            catch (Exception ex)
            {
                result.IsOk           = false;
                result.Exception      = ex;
                result.HttpStatusCode = HttpStatusCode.InternalServerError;
            }

            result.ResponseTime = string.Format("{0:yyyy/MM/dd HH:mm:ss}", DateTime.Now);
            return(Json(result, JsonRequestBehavior.DenyGet));
        }