Esempio n. 1
0
        /// <summary>
        /// Get All Pricing Detail
        /// </summary>
        /// <returns></returns>

        public JsonResult GetPricingDetails()
        {
            PricingViewModel playerViewModel = new PricingViewModel()
            {
            };

            HttpResponseMessage response = new APIHelper.APICallMethod().GetHttpResponseMessage("GetAllPricing", "AdminPanel", playerViewModel);

            if (response.IsSuccessStatusCode)
            {
                var data = response.Content.ReadAsStringAsync().Result;
                ViewModel.ResponseModel.ResponseViewModel <List <ViewModel.PricingViewModel> > dbBookingDetails = JsonConvert.DeserializeObject <ViewModel.ResponseModel.ResponseViewModel <List <ViewModel.PricingViewModel> > >(data);
                if (dbBookingDetails.IdentityResult.Status == true)
                {
                    string convertedData = Common.HtmlHelper.RenderViewToString(this.ControllerContext, "~/Views/SearchPricing/_Search.cshtml", dbBookingDetails.Content);

                    return(Json(new { code = 0, message = convertedData }));
                }
                else
                {
                    if (dbBookingDetails.IdentityResult.Message == "Invalid access details, Please log-out.")
                    {
                        return(Json(new { code = -99, message = "Please Login Again" }));
                    }
                    else
                    {
                        return(Json(new { code = -1, message = dbBookingDetails.IdentityResult.Message }));
                    }
                }
            }
            else
            {
                return(Json(new { code = -2, message = "failed" }));
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Save Pricing Detail
        /// </summary>
        /// <param name="pricingViewModel"></param>
        /// <returns></returns>
        public JsonResult SavePricing(PricingViewModel pricingViewModel)
        {
            pricingViewModel.IsSpecialPricing = false;
            HttpResponseMessage response = new APIHelper.APICallMethod().GetHttpResponseMessage("SavePricingNewMultiple", "AdminPanel", pricingViewModel);

            if (response.IsSuccessStatusCode)
            {
                var data = response.Content.ReadAsStringAsync().Result;
                ViewModel.ResponseModel.ResponseViewModel <Dictionary <string, bool> > dbBookingDetails = JsonConvert.DeserializeObject <ViewModel.ResponseModel.ResponseViewModel <Dictionary <string, bool> > >(data);
                if (dbBookingDetails.IdentityResult.Status == true)
                {
                    return(Json(new { code = 0, message = "Success" }));
                }
                else
                {
                    if (dbBookingDetails.IdentityResult.Message == "Invalid access details, Please log-out.")
                    {
                        return(Json(new { code = -99, message = "Please Login Again" }));
                    }
                    else
                    {
                        return(Json(new { code = -1, message = dbBookingDetails.IdentityResult.Message }));
                    }
                }
            }
            else
            {
                return(Json(new { code = -2, message = "failed" }));
            }
        }
Esempio n. 3
0
        public IActionResult ShowPricing(PricingViewModel pricing)
        {
            if (ModelState.IsValid)
            {
                int temp;
                if (!int.TryParse(pricing.colCode, out temp))
                {
                    ViewBag.isValid = 0;
                    ModelState.AddModelError("colCode", "Invalid Data");
                    return(ViewComponent("PricingComponent", new { pricing = pricing })); // 1
                }
                else if (!int.TryParse(pricing.colName, out temp))
                {
                    ViewBag.isValid = 0;
                    ModelState.AddModelError("colName", "Invalid Data");
                    return(ViewComponent("UpdatePricingComponent", new { pricing = pricing })); //2
                }
                else
                {
                    ViewBag.isValid = 1;

                    // do something ...

                    return(ViewComponent("ShowPricingExcelComponent")); //Call another view component
                }
            }
            else
            {
                ViewBag.isValid = 0;
                return(ViewComponent("UpdatePricingComponent", new { pricing = pricing })); //3
            }
        }
Esempio n. 4
0
        // GET: Movie
        public ActionResult Index()
        {
            movieViewModel        = new MovieDisplayViewModel();
            performancesViewModel = new PerformancesViewModel();
            posterViewModel       = new PosterViewModel();
            pricingViewModel      = new PricingViewModel();
            posterURLs            = new List <string>();
            movieInfo             = new Dictionary <PerformancesViewModel, MovieDisplayViewModel>();

            //used in GetShows
            showsToday  = new List <ShowingsViewModel>();
            showsToday2 = new List <ShowingsViewModel>();

            pricingList = pricingViewModel.GetPricing();

            //obtain performances for today
            IList <PerformancesViewModel> allPerfs = performancesViewModel.GetPerformancesToday();
            //sort by auditorium number
            IList <PerformancesViewModel> allPerfsSorted = allPerfs.OrderBy(x => x.auditorium).ToList();

            //find movies for running shows
            posterURLs = posterViewModel.GetPosters(allPerfs);

            GetShows(allPerfsSorted);

            //asign data to ViewData
            ViewData["posters"]       = posterURLs;
            ViewData["pricing"]       = pricingList;
            ViewData["performances"]  = showsToday;
            ViewData["performances2"] = showsToday2;

            return(View());
        }
Esempio n. 5
0
        // GET: Pricing
        public ActionResult Index()
        {
            var fuel    = db.FuelPricing.OrderByDescending(x => x.Id).FirstOrDefault();
            var carWash = db.CarWashPricing.OrderByDescending(x => x.Id).FirstOrDefault();

            var viewModel = new PricingViewModel()
            {
                Fuel    = fuel,
                CarWash = carWash
            };

            return(View(viewModel));
        }
        // GET: AddSpecialPricing
        public ActionResult Index()
        {
            PricingViewModel pricingViewModel = new PricingViewModel()
            {
                SlotViewModels          = GetAllSlotTime(),
                HoleTypeViewModels      = GetAllHoleType(),
                MemberTypeViewModels    = GetAllMemberType(),
                BookingTypeViewModels   = GetAllBookingType(),
                TaxManagementViewModels = GetAllTaxs()
            };

            return(View(pricingViewModel));
        }
Esempio n. 7
0
 public async Task <IViewComponentResult> InvokeAsync(PricingViewModel pricing)
 {
     return(await Task.FromResult((IViewComponentResult)View("PricingView", pricing)));
 }