public static int GetPet(TouristUnitViewModel model) { int pets = model.Pets; int index = 0; if (pets == 0) { index = 0; } else if (pets == 6) { index = 1; } else if (pets == 30) { index = 2; } else if (pets == 99) { index = 3; } return(index); }
protected void btnResetStopBooking_Click(object sender, EventArgs e) { model = controller.GetTouristUnit(id); List <DateInterval> unitstopbooking = model.UnitStopBooking; var sd = Getunitbooking(unitstopbooking); unitstopbooking = sd; var selectList = calendarUnit.SelectedDates.ToList(); DateInterval interval = new DateInterval(); DateTime From = selectList[0].Date; DateTime To = selectList[selectList.Count - 1].Date; interval.FromDate = From; interval.ToDate = To; var t = unitstopbooking.Find(m => m.FromDate == interval.FromDate && m.ToDate == interval.ToDate); unitstopbooking.Remove(t); model.UnitStopBooking = unitstopbooking; model.LastChange = DateTime.Now; controller.UpdateTouristUnit(model); int i = 0; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { PageUnitControl.ActiveTabIndex = 0; Uri u = HttpContext.Current.Request.Url; id = HttpUtility.ParseQueryString(u.Query).Get("id"); sitecode = HttpUtility.ParseQueryString(u.Query).Get("sc"); unitcode = HttpUtility.ParseQueryString(u.Query).Get("uc"); ViewState["id"] = id; ViewState["sitecode"] = sitecode; ViewState["unitcode"] = unitcode; model = controller.GetTouristUnit(id); firstload = true; Bind(); folder = CreateFolder(sitecode, unitcode); ViewState["folder"] = folder; } else { id = (string)ViewState["id"]; sitecode = (string)ViewState["sitecode"]; unitcode = (string)ViewState["unitcode"]; folder = (string)ViewState["folder"]; model = controller.GetTouristUnit(id); var offers = offercontroller.GetUnitOfferByCode(sitecode, unitcode); GridUnitOfferView.DataSource = offers; GridUnitOfferView.DataBind(); } }
protected void btnSubmita_Click(object sender, EventArgs e) { model = controller.GetTouristUnit(id); model.Description = HtmlEditorPageBeschreibung.Html; controller.UpdateTouristUnit(model); BindBeschreibung(); }
public static void AddMasterData(TouristUnitViewModel model) { var manager = PlugInManager.GetMasterDataManager(); var touristunit = new IdomOffice.Interface.BackOffice.MasterData.TouristUnit(); touristunit.id = Guid.NewGuid().ToString(); touristunit.Bathrooms = model.Bathrooms; touristunit.Bedroom = model.Bedroom; touristunit.SiteCode = model.SiteCode; touristunit.SiteName = model.SiteName; //touristunit.Beds = model.Beds; touristunit.ImageGalleryPath = model.ImageGalleryPath; touristunit.ImageThumbnailsPath = model.ImageThumbnailsPath; touristunit.CloseDate = model.CloseDate; touristunit.CountryName = model.CountryName; touristunit.MaxAdults = model.MaxAdults; touristunit.MaxPersons = model.MaxPersons; touristunit.MobilhomeArea = model.MobilhomeArea; touristunit.OpenDate = model.OpenDate; touristunit.PlaceName = model.PlaceName; touristunit.PurchasePriceListId = model.PurchasePriceListId; touristunit.RegionName = model.RegionName; touristunit.TerraceArea = model.TerraceArea; touristunit.TourOperatorCode = model.TourOperatorCode; touristunit.TravelServiceProvider = model.TravelServiceProvider; touristunit.UnitCode = model.UnitCode; touristunit.UnitOfferInfoList = model.UnitOfferInfoList; touristunit.UnitTitel = model.UnitTitel; manager.AddMasterData(touristunit); }
private void BindDaten() { model = controller.GetTouristUnit(id); var layoutdaten = controller.GetLayoutDaten(model); LayoutDaten.DataSource = layoutdaten; LayoutDaten.DataBind(); }
public static LayoutDatenViewModel GetLayoutDatenModel(TouristUnitViewModel model) { LayoutDatenViewModel data = new LayoutDatenViewModel(); data.CloseDate = model.CloseDate; data.MaxAdults = model.MaxAdults; data.MaxPersons = model.MaxPersons; data.OpenDate = model.OpenDate; return(data); }
protected void btnSetStopBooking_Click(object sender, EventArgs e) { var selectList = calendarUnit.SelectedDates.ToList(); model = controller.GetTouristUnit(id); var unitstopbooking = GetData(selectList); model.UnitStopBooking = unitstopbooking; model.LastChange = DateTime.Now; controller.UpdateTouristUnit(model); }
protected void GridTouristUnitView_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { var listSaP = (List <TouristUnitViewModel>)GridTouristUnitView.DataSource; TouristUnitViewModel model = listSaP.Find(m => m.id == e.Keys[0].ToString()); model.Bathrooms = e.NewValues["Bathrooms"] == null ? 0 : (int)e.NewValues["Bathrooms"]; model.Bedroom = e.NewValues["Bedroom"] == null ? 0 : (int)e.NewValues["Bedroom"]; // model.SiteCode = e.NewValues["SiteCode"].ToString() ?? string.Empty; //model.SiteName = e.NewValues["SiteName"].ToString() ?? string.Empty; //model.Beds = e.NewValues["Beds"] == null ? 0 : (int)e.NewValues["Beds"]; //model.ImageGalleryPath = e.NewValues["ImageGalleryPath"].ToString() ?? string.Empty; //model.ImageThumbnailsPath = e.NewValues["ImageThumbnailsPath"].ToString() ?? string.Empty; model.CloseDate = e.NewValues["CloseDate"] == null ? DateTime.Now : (DateTime)e.NewValues["CloseDate"]; //model.CountryName = e.NewValues["CountryName"].ToString() ?? string.Empty; model.MaxAdults = e.NewValues["MaxAdults"] == null ? 0 : (int)e.NewValues["MaxAdults"]; model.Description = e.NewValues["Description"] == null ? string.Empty : e.NewValues["Description"].ToString(); model.MaxPersons = e.NewValues["MaxPersons"] == null ? 0 : (int)e.NewValues["MaxPersons"]; model.MobilhomeArea = e.NewValues["MobilhomeArea"] == null ? 0 : (int)e.NewValues["MobilhomeArea"]; model.OpenDate = e.NewValues["OpenDate"] == null ? DateTime.Now : (DateTime)e.NewValues["OpenDate"]; //model.PlaceName = e.NewValues["PlaceName"].ToString() ?? string.Empty; //model.RegionName = e.NewValues["RegionName"].ToString() ?? string.Empty; model.TerraceArea = e.NewValues["TerraceArea"] == null ? 0 : (int)e.NewValues["TerraceArea"]; model.TourOperatorCode = e.NewValues["TourOperatorCode"].ToString() ?? string.Empty; model.TravelServiceProvider = (string)e.NewValues["TravelServiceProvider"] ?? string.Empty; model.UnitCode = e.NewValues["UnitCode"].ToString() ?? string.Empty; //model.UnitOfferInfoList = (List<UnitOfferInfo>)e.NewValues["SiteName"]; model.UnitTitel = e.NewValues["UnitTitel"].ToString() ?? string.Empty; TouristUnitViewModel touristunit = new TouristUnitViewModel(); if (model.SiteCode != null) { //TODO: Ove podatke ne treba ovdje puniti nego u Repositoriju // prebaciti model u Repository i dodati property koje fale //Ili pozvati jednu funkciju koja vraca jedan objekt sa svim GEO informacijama touristunit = controller.GetTouristUnit(model); } //bool contains = controller.ContainsUnitCode(model.UnitCode); //if (!contains) //{ controller.UpdateTouristUnit(touristunit); //} e.Cancel = true; GridTouristUnitView.CancelEdit(); Bind(); }
private List <DateInterval> GetData(List <DateTime> values) { model = controller.GetTouristUnit(id); List <DateInterval> unitstopbooking = model.UnitStopBooking; DateTime OpenDate = model.OpenDate.Date; DateTime CloseDate = model.CloseDate.Date; DateTime FromDate = values[0].Date; DateTime ToDate = values[values.Count - 1].Date; List <DateTime> alldates = new List <DateTime>(); List <DateTime> booked = new List <DateTime>(); List <DateTime> list = new List <DateTime>(); DateInterval newinterval; if (unitstopbooking == null && FromDate >= OpenDate && ToDate <= CloseDate) { List <DateInterval> intervals = new List <DateInterval>(); DateInterval interval = new DateInterval(); interval.FromDate = FromDate; interval.ToDate = ToDate; intervals.Add(interval); return(intervals); } if (FromDate < OpenDate || ToDate > CloseDate) { return(unitstopbooking); } booked = GetBooking(unitstopbooking); alldates = GetDates(OpenDate, CloseDate); List <DateTime> differences = GetDifferences(alldates, booked); List <List <DateTime> > lists = GetLists(differences); bool isOk = isAvailable(lists, FromDate, ToDate); if (isOk) { newinterval = new DateInterval(); newinterval.FromDate = FromDate; newinterval.ToDate = ToDate; unitstopbooking.Add(newinterval); } return(unitstopbooking); }
public static int GetTerraceType(TouristUnitViewModel model) { string terracetype = model.TerraceType; int index = 0; if (terracetype == "Typ 1") { index = 0; } else if (terracetype == "Typ 2") { index = 1; } return(index); }
public static int GetSiteLocation(TouristUnitViewModel model) { string sitelocation = model.LocationSite; int index = 0; if (sitelocation == "Standort 1") { index = 0; } else if (sitelocation == "Standort 2") { index = 1; } return(index); }
public static int GetSeaLocation(TouristUnitViewModel model) { string sealocation = model.LocationSea; int index = 0; if (sealocation == "Lage 1") { index = 0; } else if (sealocation == "Lage 2") { index = 1; } return(index); }
public static LayoutInfoViewModel GetLayoutInfoModel(TouristUnitViewModel model) { LayoutInfoViewModel data = new LayoutInfoViewModel(); data.AirConditioning = model.AirConditioning; data.Bathrooms = model.Bathrooms; data.BeachDistanceFrom = model.BeachDistanceTo; data.Bedrooms = model.Bedrooms; data.BunkBeds = model.BunkBeds; data.Disabled = model.Disabled; data.DoubleBeds = model.DoubleBeds; data.ExtraBeds = model.ExtraBeds; data.ExtraEquipment = model.ExtraEquipment; data.Kettle = model.Kettle; data.LocationSea = model.LocationSea; data.LocationSite = model.LocationSite; data.MobilehomeSize = model.MobilehomeSize; data.OtherFeatures = model.OtherFeatures; data.ParcelSize = model.ParcelSize; data.PriceInclusive = model.PriceInclusive; data.SingleBeds = model.SingleBeds; data.SolarShower = model.SolarShower; data.Sunloungers = model.Sunloungers; data.Sunshade = model.Sunshade; data.TerraceSize = model.TerraceSize; data.TerraceType = model.TerraceType; data.UnitType = model.UnitType; data.WC = model.WC; data.WoodenFurniture = model.WoodenFurniture; data.Coffeemachine = model.Coffeemachine; data.Fridge = model.Fridge; data.Childbed = model.Childbed; data.DVDPlayer = model.DVDPlayer; data.Towel = model.Towel; data.BedWashing = model.BedWashing; data.Parkinglot = model.Parkinglot; data.FinishCleaning = model.FinishCleaning; data.WiFiInternetPriceFree = model.WiFiInternetPriceFree; data.WiFiInternet = model.WiFiInternet; data.Pool = model.Pool; return(data); }
private void BindObjektInfo() { model = controller.GetTouristUnit(id); if (txtMaxBelegung.Text != null) { txtMaxBelegung.Text = model.MaxPersons.ToString(); } if (txtErwachsene.Text != null) { txtErwachsene.Text = model.MaxAdults.ToString(); } comboHaustier.DataSource = DataManager.GetPets(); comboHaustier.DataBind(); int index = controller.GetPet(model); comboHaustier.SelectedIndex = index; var layoutinfo = controller.GetLayoutInfo(model); LayoutObjektInfo.DataSource = layoutinfo; LayoutObjektInfo.DataBind(); ASPxComboBox comboboxType = (ASPxComboBox)LayoutObjektInfo.FindNestedControlByFieldName("TerraceType"); comboboxType.DataSource = DataManager.GetTerraceTypes(); comboboxType.DataBind(); index = controller.GetTerraceType(model); comboboxTerasseTyp.SelectedIndex = index; ASPxComboBox comboboxSea = (ASPxComboBox)LayoutObjektInfo.FindNestedControlByFieldName("LocationSea"); comboboxSea.DataSource = DataManager.GetDistances(); comboboxSea.DataBind(); index = controller.GetSeaLocation(model); comboboxSea.SelectedIndex = index; ASPxComboBox comboboxSite = (ASPxComboBox)LayoutObjektInfo.FindNestedControlByFieldName("LocationSite"); comboboxSite.DataSource = DataManager.GetPositions(); comboboxSite.DataBind(); index = controller.GetSiteLocation(model); comboboxSite.SelectedIndex = index; }
public static TouristUnitViewModel GetTouristUnit(TouristUnitViewModel model) { TouristUnitViewModel unit = new TouristUnitViewModel(); unit = model; string sitecode = model.SiteCode; string country = GetCountryFromSite(sitecode); string region = GetRegionFromSite(sitecode); string place = GetPlaceFromSite(sitecode); string sitename = GetSiteNameFromSite(sitecode); unit.CountryName = country; unit.RegionName = region; unit.PlaceName = place; unit.SiteName = sitename; return(unit); }
private void BindBeschreibung() { model = controller.GetTouristUnit(id); HtmlEditorPageBeschreibung.Html = model.Description; }
private void BindBeschreibungKurz() { model = controller.GetTouristUnit(id); HtmlEditorKurzBeschreibung.Html = model.ShortDescription; lblKurz.Text = GetText().Length.ToString(); }
public void AddTouristUnit(TouristUnitViewModel model) { MasterDataRepository.AddMasterData(model); }
public TouristUnitViewModel GetTouristUnit(TouristUnitViewModel model) { return(MasterDataRepository.GetTouristUnit(model)); }
public int GetSeaLocation(TouristUnitViewModel model) { return(MasterDataRepository.GetSeaLocation(model)); }
public int GetTerraceType(TouristUnitViewModel model) { return(MasterDataRepository.GetTerraceType(model)); }
public static void UpdateMasterData(TouristUnitViewModel model) { var manager = PlugInManager.GetMasterDataManager(); var touristunit = manager.GetTouristUnitById(model.id); touristunit.Bathrooms = model.Bathrooms; touristunit.Bedroom = model.Bedroom; touristunit.SiteCode = model.SiteCode; touristunit.SiteName = model.SiteName; //touristunit.Beds = model.Beds; touristunit.ImageGalleryPath = model.ImageGalleryPath; touristunit.ImageThumbnailsPath = model.ImageThumbnailsPath; touristunit.CloseDate = model.CloseDate; touristunit.CountryName = model.CountryName; touristunit.MaxAdults = model.MaxAdults; touristunit.MaxPersons = model.MaxPersons; touristunit.MobilhomeArea = model.MobilhomeArea; touristunit.OpenDate = model.OpenDate; touristunit.PlaceName = model.PlaceName; touristunit.PurchasePriceListId = model.PurchasePriceListId; touristunit.RegionName = model.RegionName; touristunit.TerraceArea = model.TerraceArea; touristunit.TourOperatorCode = model.TourOperatorCode; touristunit.TravelServiceProvider = model.TravelServiceProvider; touristunit.UnitCode = model.UnitCode; touristunit.UnitOfferInfoList = model.UnitOfferInfoList; touristunit.UnitTitel = model.UnitTitel; touristunit.Kettle = model.Kettle; // touristunit.LocationSea = model.LocationSea; // touristunit.LocationSite = model.LocationSite; touristunit.MobilehomeSize = model.MobilehomeSize; touristunit.OtherFeatures = model.OtherFeatures; touristunit.ParcelSize = model.ParcelSize; touristunit.Pets = model.Pets; touristunit.PriceInclusive = model.PriceInclusive; touristunit.ShortDescription = model.ShortDescription; touristunit.SingleBeds = model.SingleBeds; touristunit.SolarShower = model.SolarShower; touristunit.Sunloungers = model.Sunloungers; touristunit.Sunshade = model.Sunshade; touristunit.TerraceSize = model.TerraceSize; //touristunit.TerraceType = model.TerraceType; touristunit.TourOperatorId = model.TourOperatorId; touristunit.TravelServiceProvider = model.TravelServiceProvider; touristunit.UnitType = model.UnitType; touristunit.WC = model.WC; touristunit.WoodenFurniture = model.WoodenFurniture; touristunit.AirConditioning = model.AirConditioning; touristunit.BeachDistanceFrom = model.BeachDistanceFrom; touristunit.BeachDistanceTo = model.BeachDistanceTo; touristunit.Bedrooms = model.Bedrooms; touristunit.BunkBeds = model.BunkBeds; touristunit.Disabled = model.Disabled; touristunit.DoubleBeds = model.DoubleBeds; touristunit.ExtraBeds = model.ExtraBeds; touristunit.ExtraEquipment = model.ExtraEquipment; touristunit.Description = model.Description; touristunit.Coffeemachine = model.Coffeemachine; touristunit.Fridge = model.Fridge; touristunit.Childbed = model.Childbed; touristunit.DVDPlayer = model.DVDPlayer; touristunit.Towel = model.Towel; touristunit.BedWashing = model.BedWashing; touristunit.Parkinglot = model.Parkinglot; touristunit.FinishCleaning = model.FinishCleaning; touristunit.WiFiInternetPriceFree = model.WiFiInternetPriceFree; touristunit.WiFiInternet = model.WiFiInternet; touristunit.Pool = model.Pool; touristunit.UnitStopBooking = model.UnitStopBooking; touristunit.LastChange = model.LastChange; manager.UpdateMasterData(touristunit); }
public LayoutInfoViewModel GetLayoutInfo(TouristUnitViewModel model) { return(MasterDataRepository.GetLayoutInfoModel(model)); }
public void UpdateTouristUnit(TouristUnitViewModel model) { MasterDataRepository.UpdateMasterData(model); }
public LayoutDatenViewModel GetLayoutDaten(TouristUnitViewModel model) { return(MasterDataRepository.GetLayoutDatenModel(model)); }
public static List <TouristUnitViewModel> GetTouristUnitViewModel() { var model = new List <TouristUnitViewModel>(); var manager = PlugInManager.GetMasterDataManager(); var data = manager.GetTouristUnits(); foreach (var TouristUnit in data) { var m = new TouristUnitViewModel(); m.id = TouristUnit.id; m.Bathrooms = TouristUnit.Bathrooms; m.Bedroom = TouristUnit.Bedroom; m.SiteCode = TouristUnit.SiteCode; m.SiteName = TouristUnit.SiteName; //m.Beds = TouristUnit.Beds; m.ImageGalleryPath = TouristUnit.ImageGalleryPath; m.ImageThumbnailsPath = TouristUnit.ImageThumbnailsPath; m.CloseDate = TouristUnit.CloseDate; m.CountryName = TouristUnit.CountryName; m.MaxAdults = TouristUnit.MaxAdults; m.MaxPersons = TouristUnit.MaxPersons; m.MobilhomeArea = TouristUnit.MobilhomeArea; m.OpenDate = TouristUnit.OpenDate; m.PlaceName = TouristUnit.PlaceName; m.PurchasePriceListId = TouristUnit.PurchasePriceListId; m.RegionName = TouristUnit.RegionName; m.TerraceArea = TouristUnit.TerraceArea; m.TourOperatorCode = TouristUnit.TourOperatorCode; m.TravelServiceProvider = TouristUnit.TravelServiceProvider; m.UnitCode = TouristUnit.UnitCode; m.UnitOfferInfoList = TouristUnit.UnitOfferInfoList; m.UnitTitel = TouristUnit.UnitTitel; m.Kettle = TouristUnit.Kettle; m.LocationSea = TouristUnit.LocationSea; m.LocationSite = TouristUnit.LocationSite; m.MobilehomeSize = TouristUnit.MobilehomeSize; m.OtherFeatures = TouristUnit.OtherFeatures; m.ParcelSize = TouristUnit.ParcelSize; m.Pets = TouristUnit.Pets; m.PriceInclusive = TouristUnit.PriceInclusive; m.ShortDescription = TouristUnit.ShortDescription; m.SingleBeds = TouristUnit.SingleBeds; m.SolarShower = TouristUnit.SolarShower; m.Sunloungers = TouristUnit.Sunloungers; m.Sunshade = TouristUnit.Sunshade; m.TerraceSize = TouristUnit.TerraceSize; m.TerraceType = TouristUnit.TerraceType; m.TourOperatorId = TouristUnit.TourOperatorId; m.TravelServiceProvider = TouristUnit.TravelServiceProvider; m.UnitType = TouristUnit.UnitType; m.WC = TouristUnit.WC; m.WoodenFurniture = TouristUnit.WoodenFurniture; m.AirConditioning = TouristUnit.AirConditioning; m.BeachDistanceFrom = TouristUnit.BeachDistanceFrom; m.BeachDistanceTo = TouristUnit.BeachDistanceTo; m.Bedrooms = TouristUnit.Bedrooms; m.BunkBeds = TouristUnit.BunkBeds; m.Disabled = TouristUnit.Disabled; m.DoubleBeds = TouristUnit.DoubleBeds; m.ExtraBeds = TouristUnit.ExtraBeds; m.ExtraEquipment = TouristUnit.ExtraEquipment; m.Description = TouristUnit.Description; m.Coffeemachine = TouristUnit.Coffeemachine; m.Fridge = TouristUnit.Fridge; m.Childbed = TouristUnit.Childbed; m.DVDPlayer = TouristUnit.DVDPlayer; m.Towel = TouristUnit.Towel; m.BedWashing = TouristUnit.BedWashing; m.Parkinglot = TouristUnit.Parkinglot; m.FinishCleaning = TouristUnit.FinishCleaning; m.WiFiInternetPriceFree = TouristUnit.WiFiInternetPriceFree; m.WiFiInternet = TouristUnit.WiFiInternet; m.Pool = TouristUnit.Pool; m.UnitStopBooking = TouristUnit.UnitStopBooking; m.LastChange = TouristUnit.LastChange; model.Add(m); } return(model); }