Esempio n. 1
0
        public SimpleSearchModel GetSimpleSearch()
        {
            SimpleSearchModel sm = new SimpleSearchModel();

            sm.Destination = Destination;
            DateTime t = DateTime.MinValue;

            DateTime.TryParse(CheckIn, out t);
            sm.CheckIn = t;
            t          = DateTime.MinValue;
            DateTime.TryParse(CheckOut, out t);
            sm.CheckOut = t;
            sm.Adults   = Adults;
            sm.Children = Children;
            sm.StayType = StayType;
            sm.Bedrooms = Bedrooms;

            sm.rangeBudgetMax     = rangeBudgetMax;
            sm.rangeBudgetMin     = rangeBudgetMin;
            sm.starRatingRange    = starRatingRange;
            sm.distanceInKm       = distanceInKm;
            sm.features           = features;
            sm.beds               = beds;
            sm.CurrentPage        = CurrentPage;
            sm.OrderBy            = OrderBy;
            sm.Location           = Location;
            sm.PropertyId         = PropertyId;
            sm.HiddenDestination  = HiddenDestination;
            sm.HiddenCheckIn      = HiddenCheckIn;
            sm.HiddenCheckOut     = HiddenCheckOut;
            sm.HidAdults          = HidAdults;
            sm.HidChildren        = HidChildren;
            sm.HidStayType        = HidStayType;
            sm.HidBedrooms        = HidBedrooms;
            sm.SessionID          = SessionID;
            sm.SequenceNumber     = SequenceNumber;
            sm.SecurityToken      = SecurityToken;
            sm.Moreindicator      = Moreindicator;
            sm.RateCardDetailedId = RateCardDetailedId;
            sm.TaxPercentage      = TaxPercentage;
            sm.StateId            = StateId;
            sm.CityId             = CityId;
            sm.AccommodationTpeID = AccommodationTpeID;
            sm.StayCategoryID     = StayCategoryID;
            sm.Amount             = Amount;
            sm.AmountWithTax      = AmountWithTax;
            sm.ResultIndex        = ResultIndex;
            sm.TraceID            = TraceID;
            //sm.ErrorCode = ErrorCode;
            sm.Description      = Description;
            sm.InventoryAPIType = InventoryAPIType;
            return(sm);
        }
Esempio n. 2
0
 public HomeModel()
 {
     Search = new SimpleSearchModel();
 }
Esempio n. 3
0
        //*
        public PropertyModel()
        {
            UserType      = CLayer.Role.Roles.Customer;
            City          = "";
            CityId        = -1;
            AccConditions = new List <CLayer.Condition>();
            Filter        = new SimpleSearchModel();
            List <SelectListItem> statusItems = new List <SelectListItem>();

            statusItems.Add(new SelectListItem()
            {
                Text = CLayer.ObjectStatus.StatusType.Active.ToString(), Value = ((int)CLayer.ObjectStatus.StatusType.Active).ToString()
            });
            statusItems.Add(new SelectListItem()
            {
                Text = CLayer.ObjectStatus.StatusType.Draft.ToString(), Value = ((int)CLayer.ObjectStatus.StatusType.Draft).ToString()
            });
            statusItems.Add(new SelectListItem()
            {
                Text = CLayer.ObjectStatus.StatusType.Disabled.ToString(), Value = ((int)CLayer.ObjectStatus.StatusType.Disabled).ToString()
            });
            //statusItems.Add(new SelectListItem() { Text = CLayer.ObjectStatus.StatusType.Deleted.ToString(), Value = ((int)CLayer.ObjectStatus.StatusType.Active).ToString() });
            StatusList         = new SelectList(statusItems, "Value", "Text");
            CameFromSearchPage = true;
            List <CLayer.Country> countries = BLayer.Country.GetAllForProperty();

            CountryList = new SelectList(countries, "CountryId", "Name");
            if (countries.Count > 0)
            {
                List <CLayer.State> states = BLayer.State.GetOnCountry((int)countries[0].CountryId);
                StateList = new SelectList(states, "StateId", "Name");
                List <CLayer.City> cities = null;
                if (states.Count > 0)
                {
                    cities = BLayer.City.GetOnState((int)states[0].StateId);
                }
                else
                {
                    cities = new List <CLayer.City>();
                }
                cities.Add(new CLayer.City()
                {
                    CityId = -1, Name = "Not avilable"
                });
                CityList = new SelectList(cities, "CityId", "Name");
            }
            Pictures       = new PropertyPicturesModel();
            Features       = new PropertyFeaturesModel();
            Accommodations = new PropertyAccommmodationModel();
            CheckHourlist  = new SelectList(new[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" });
            CheckMinlist   = new SelectList(new[] { "00", "15", "30", "45" });
            Checkclock     = new SelectList(new[] { "AM", "PM" });
            Status         = (int)CLayer.ObjectStatus.StatusType.Active;



            List <CLayer.B2BUser> CorporateList = BLayer.B2BUser.GetCorporateName();

            CorporateName = new SelectList(CorporateList, "B2BId", "FirstName");
            //For getting Corporate User's Name under Corporate
            List <CLayer.B2BUser> CorporateUserList = BLayer.B2BUser.GetOnCorporateUserList((int)CorporateList[0].B2BId);

            CorporateUserName = new SelectList(CorporateUserList, "UserId", "FirstName");

            var myid = System.Web.HttpContext.Current.User.Identity.GetUserId();//This is for getting Login User Id
            List <CLayer.B2BUser> CorporateName_UnderLogin = BLayer.B2BUser.getoncorporateusername(myid);

            CorporateName1 = new SelectList(CorporateName_UnderLogin, "B2BId", "B2BId");
            //Below Code is used for AssistedCorporate User list
            if (CorporateName_UnderLogin.Count > 0)
            {
                List <CLayer.B2BUser> CorporateAssistedUserList = BLayer.B2BUser.getAllAssistedCorporateUserNames((int)CorporateName_UnderLogin[0].B2BId, myid);
                CorporateUserName_ForCorporateUsers = new SelectList(CorporateAssistedUserList, "UserId", "FirstName");
            }
            else
            {
                List <CLayer.B2BUser> CorporateAssistedUserList = BLayer.B2BUser.getAllCorporateUserName(myid);
                CorporateUserName_ForCorporateUsers = new SelectList(CorporateAssistedUserList, "UserId", "FirstName");
            }

            List <CLayer.B2BUser> MyAssistedUserList = BLayer.B2BUser.getMyAssistedUsername(myid);

            MyAssistedUsers = new SelectList(MyAssistedUserList, "UserId", "FirstName");
        }