public JsonResult GetAccomodationByID()
 {
     BizContext = (BizContext)Session["GBAdminBizContext"];
      int id = BizContext.HotelAccommodationTypeID;
      Session["GBAdminBizContext"] = BizContext;
      DropDownListsRepository model = new DropDownListsRepository();
      return Json(model.GetTypeHotelAccommodationByID(id).OrderBy(o => o.Name).Select(c => new { ID = c.ID, Name = c.Name }).OrderBy(o => o.Name), JsonRequestBehavior.AllowGet);
 }
        public JsonResult GetAirportDropDown()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            // return Json(modelRepo.GetRegion().OrderBy(o => o.ID).Select(c => new { RegionID = c.ID, Region = c.ID }).OrderBy(o => o.RegionID), JsonRequestBehavior.AllowGet);
            return new JsonResult()
            {
                Data = (modelRepo.GetClosestAirportDropdown().OrderBy(o => o.Name).Select(c => new { Value = c.ID, Text = c.Name }).OrderBy(o => o.Text)),

                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                MaxJsonLength = Int32.MaxValue
                //Use this value to set your maximum size for all of your Requests
            };
        }
 public void LoadViewBagPromotion( int Hotelid)
 {
     DropDownListsRepository DrpRep = new DropDownListsRepository();
       NewPromotionRepository NewProm = new NewPromotionRepository();
       ViewBag.PricePolicies = DrpRep.GetPricePlicy();
       ViewBag.HotelRooms = NewProm.GetHotelRooms(Hotelid);
       ViewBag.DaysDetails = NewProm.GetDay();
       int MinimumPromotionDiscountPercentage = NewProm.GetParameterValue("MinimumPromotionDiscountPercentage");
       int MaximumPromotionDiscountPercentage = NewProm.GetParameterValue("MaximumPromotionDiscountPercentage");
       ViewBag.MinimumPromotionDiscountPercentage = MinimumPromotionDiscountPercentage;
       ViewBag.MaximumPromotionDiscountPercentage = MaximumPromotionDiscountPercentage;
       ViewBag.DefaultPromotionDiscountPercentage = NewProm.GetParameterValue("DefaultPromotionDiscountPercentage");
       ViewBag.MaximumDayCountForMinimumStayPromotion = NewProm.GetParameterValue("MaximumDayCountForMinimumStayPromotion");
       ViewBag.MaximumHourCountForMinimumStayPromotion = NewProm.GetParameterValue("MaximumHourCountForMinimumStayPromotion");
       ViewBag.DiscountPercentValidation = Resources.Resources.RangeWarning + " " + Resources.Resources.MinimumValue + ": " + MinimumPromotionDiscountPercentage + " ," + Resources.Resources.MaximumValue + ": " + MaximumPromotionDiscountPercentage;
 }
        public static SelectList GetAllCreditCardList()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();
            var Firms = modelRepo.GetCreditCardType();

            List<SelectListItem> _Listfirms = new List<SelectListItem>();

                foreach (var item in Firms)
                {
                    SelectListItem itr = new SelectListItem();
                    itr.Text = item.Name;
                    itr.Value = item.ID.ToString();
                    itr.Selected = false;

                    _Listfirms.Add(itr);
                }

            return new SelectList(_Listfirms, "Value", "Text");
        }
        public static SelectList FillTimeList(int starttime,int endtime, string Time)
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();
            var Firms = modelRepo.FillTimeList(starttime, endtime);

            List<SelectListItem> _Listfirms = new List<SelectListItem>();

                foreach (var item in Firms)
                {
                    SelectListItem itr = new SelectListItem();
                    itr.Text = item.TimeID;
                    itr.Value = item.TimeID.ToString();
                    itr.Selected = false;

                    _Listfirms.Add(itr);
                }

            return new SelectList(_Listfirms, "Value", "Text", Time);
        }
        public static SelectList FillYearList(string Year)
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();
            var Firms = modelRepo.FillYearList();

            List<SelectListItem> _Listfirms = new List<SelectListItem>();

                foreach (var item in Firms)
                {
                    SelectListItem itr = new SelectListItem();
                    itr.Text = item.Name;
                    itr.Value = item.ID.ToString();
                    itr.Selected = false;

                    _Listfirms.Add(itr);
                }

            return new SelectList(_Listfirms, "Value", "Text", Year);
        }
 public JsonResult GetTypePenaltyRatewithPartID()
 {
     DropDownListsRepository modelRepo = new DropDownListsRepository();
      int PartID = 1;
      var PenaltyRate = modelRepo.GetPenaltyRate().FindAll(f => f.PartID == PartID);
      return Json(PenaltyRate, JsonRequestBehavior.AllowGet);
 }
        public JsonResult GetTypeInvoiceStatus()
        {
            DropDownListsRepository model = new DropDownListsRepository();

             return Json(model.GetTypeInvoiceStatus().OrderBy(o => o.Name).Select(c => new { InvoiceStatusID = c.ID, InvoiceStatus = c.Name }).OrderBy(o => o.InvoiceStatus), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetReservationOperation()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

             return Json(modelRepo.GetReservationOperation().OrderBy(o => o.Name).Select(c => new { ReservationOperationID = c.ID, ReservationOperationName = c.Name }).OrderBy(o => o.ReservationOperationID), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetAuthority()
        {
            DropDownListsRepository model = new DropDownListsRepository();

            return Json(model.GetAuthority().OrderBy(o => o.Name).Select(c => new { AuthorityID = c.ID, Authority = c.Name }).OrderBy(o => o.AuthorityID), JsonRequestBehavior.AllowGet);
        }
        public JsonResult Role()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.ReadRoles().OrderBy(o => o.Code).Select(c => new { RoleID = c.ID, Role = c.Code }).OrderBy(o => o.Role), JsonRequestBehavior.AllowGet);
        }
        public JsonResult RequestType()
        {
            DropDownListsRepository model = new DropDownListsRepository();

            return Json(model.ReadRequest().OrderBy(o => o.RequestType).Select(c => new { RequestTypeID = c.ID, RequestType = c.RequestType }).OrderBy(o => o.RequestType), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetYear(int startyear)
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

             return Json(modelRepo.GetYear(startyear).OrderBy(o => o.year).Select(c => new { year = c.year }).OrderBy(o => o.year), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetTransferCurrency()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.ReadCurrencies().OrderBy(o => o.Name).Select(c => new { TransferCurrencyID = c.ID, TransferCurrency = c.Name }).OrderBy(o => o.TransferCurrency), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetTourFrequency()
        {
            DropDownListsRepository model = new DropDownListsRepository();

            return Json(model.GetTourFrequency().OrderBy(o => o.Name).Select(c => new { TourFrequencyID = c.ID, TourFrequency = c.Name }).OrderBy(o => o.TourFrequency), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetTourDepositType()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.GetTypeDeposit().OrderBy(o => o.Name).Select(c => new { TourDepositTypeID = c.ID, TourDepositType = c.Name }).OrderBy(o => o.TourDepositType), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetTemplate()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.ReadTemplate().OrderBy(o => o.Name).Select(c => new { MailTemplateID = c.ID, Template = c.Name }).OrderBy(o => o.Template), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetSmokingType()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.GetSmokingType().OrderBy(o => o.ID).Select(c => new { SmokingTypeID = c.ID, SmokingType = c.Name }).OrderBy(o => o.SmokingType), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetSecurityGroup()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.ReadSecurityGroup().OrderBy(o => o.Name).Select(c => new { SecurityGroupId = c.ID, Role = c.Name }).OrderBy(o => o.Role), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetTypeView()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.GetTypeView().OrderBy(o => o.ID).Select(c => new { ViewTypeID = c.ID, TypeView = c.Name }).OrderBy(o => o.TypeView), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetUser()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.ReadUser().OrderBy(o => o.Name).Select(c => new { UserID = c.ID, User = c.Name }).OrderBy(o => o.User), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetRegionsDropdown(string RCountryID, string ParentRegionID, string Latitude, string Longitude)
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();
            return new JsonResult()
            {
                Data = (modelRepo.GetRegionsDropdown(RCountryID, ParentRegionID, Latitude, Longitude).OrderBy(o => o.Name).Select(c => new { Value = c.ID, Text = c.Name }).OrderBy(o => o.Text)),

                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                MaxJsonLength = Int32.MaxValue
                //Use this value to set your maximum size for all of your Requests
            };
        }
        public JsonResult ReadFirmRequestStatus()
        {
            DropDownListsRepository model = new DropDownListsRepository();

            return Json(model.ReadFirmRequestStatus().OrderBy(o => o.RequestStatus).Select(c => new { FirmRequestStatusID = c.ID, FirmRequestStatus = c.RequestStatus }).OrderBy(o => o.FirmRequestStatus), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetTransferPeriod()
        {
            DropDownListsRepository model = new DropDownListsRepository();

            return Json(model.GetTransferPeriod().OrderBy(o => o.Name).Select(c => new { TransferPeriodID = c.ID, TransferPeriodName = c.Name }).OrderBy(o => o.TransferPeriodName), JsonRequestBehavior.AllowGet);
        }
        public JsonResult ReservationID()
        {
            DropDownListsRepository model = new DropDownListsRepository();

            return Json(model.ReadReservationID().OrderBy(o => o.ID).Select(c => new { ReservationID = c.ID }).OrderBy(o => o.ReservationID), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetTypeFirmRequest()
        {
            DropDownListsRepository model = new DropDownListsRepository();

            return Json(model.GetTypeFirmRequest().OrderBy(o => o.Name).Select(c => new { FirmRequestID = c.ID, FirmRequest = c.Name }).OrderBy(o => o.FirmRequestID), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetAttributeType()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.ReadAttributeType().OrderBy(o => o.Name).Select(c => new { AttributeTypeID = c.ID, AttributeType = c.Name }).OrderBy(o => o.AttributeType), JsonRequestBehavior.AllowGet);
        }
 public JsonResult GetTypeHotelChain()
 {
     DropDownListsRepository modelRepo = new DropDownListsRepository();
      return Json(modelRepo.GetTypeHotelChain().OrderBy(o => o.Name).Select(c => new { ID = c.ID, Name = c.Name }).OrderBy(o => o.Name), JsonRequestBehavior.AllowGet);
 }
        public JsonResult GetTraveller()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.GetTravellerType().OrderBy(o => o.Name).Select(c => new { TravellerID = c.ID, TravellerName = c.Name }).OrderBy(o => o.TravellerName), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetReviewTypeDropdown()
        {
            DropDownListsRepository modelRepo = new DropDownListsRepository();

            return Json(modelRepo.GetReviewType().OrderBy(o => o.Name).Select(c => new { ReviewTypeID = c.ID, ReviewTypeName = c.Name }).OrderBy(o => o.ReviewTypeName), JsonRequestBehavior.AllowGet);
        }