コード例 #1
0
        private void ReloadPass(bool isNew = false)
        {
            if (isNew)
            {
                _hotelRepository   = new HotelRepository();
                _productRepository = new ProductRepository();
                _isReload          = true;
            }
            var passLimit = _hotelRepository.GetDailyPassLimit(_hotels.HotelId);

            CurrentPass.Text = passLimit.DailyPass.ToString();
            HidPass.Value    = passLimit.DailyPass.ToString();

            CurrentCabana.Text = passLimit.CabanaPass.ToString();
            HidCabana.Value    = passLimit.CabanaPass.ToString();

            CurrentSpa.Text  = passLimit.SpaPass.ToString();
            HidSpaPass.Value = passLimit.SpaPass.ToString();

            CurrentDayBed.Text = passLimit.DaybedPass.ToString();
            HidDayBed.Value    = passLimit.DaybedPass.ToString();

            var addOns = _productRepository.GetByHotelId(_hotels.HotelId, (int)Enums.ProductType.AddOns);

            RptAddOns.DataSource = addOns;
            RptAddOns.DataBind();
        }
コード例 #2
0
        protected void Page_Init(object sender, EventArgs e)
        {
            string sessionHotel = Session["Hotel"] != null ? Session["Hotel"].ToString() : string.Empty;

            _hotels = _hotelRepository.GetById(int.Parse(sessionHotel));
            if (_hotels == null)
            {
                Response.Redirect(Constant.HotelList);
            }
            Session["Active"] = "Iventory";

            // Add item 1 to 70
            Helper.CreateControl(DailyCapacity);
            Helper.CreateControl(CabanaDailyLimit);
            Helper.CreateControl(SpaPassDailyLimit);
            Helper.CreateControl(DayBedDailyLimit);

            if (!IsPostBack)
            {
                ReloadPass();
            }
            if (_hotels != null)
            {
                var addOns = _productRepository.GetByHotelId(_hotels.HotelId, (int)Enums.ProductType.AddOns);
                RptAddOns.DataSource = addOns;
                RptAddOns.DataBind();
            }
        }
        private void ReloadPass(bool isNew = false)
        {
            if (isNew)
            {
                _hotelRepository   = new HotelRepository();
                _productRepository = new ProductRepository();
                _isReload          = true;
            }

            var addOns = _productRepository.GetByHotelId(PublicHotel.HotelId, (int)Enums.ProductType.AddOns);

            RptAddOns.DataSource = addOns;
            RptAddOns.DataBind();
        }