Beispiel #1
0
        /****************Site***********************/
        public static Sites SiteToDB(CommonSite commonSite)
        {
            Sites site = new Sites()
            {
                SiteId        = commonSite.SiteId,
                Name          = commonSite.Name,
                Description   = commonSite.Description,
                Category      = commonSite.Category,
                Area          = commonSite.Area,
                AddressGMaps  = commonSite.AddressGMaps,
                OpeningHour   = commonSite.OpeningHour,
                ClosingHour   = commonSite.ClosingHour,
                EstimatedStay = commonSite.EstimatedStay,
                Price         = commonSite.Price,
            };

            site.EquipmentSites = new List <EquipmentSites>();
            foreach (String e in commonSite.Equipment)
            {
                EquipmentSites equipmentSites = new EquipmentSites
                {
                    SiteId      = site.SiteId,
                    EquipmentId = DataEquipment.GetEquipmentIdByName(e)
                };
                site.EquipmentSites.Add(equipmentSites);
            }
            //foreach(CommonTripSite ts in commonSite.TripSite)
            //{
            //    site.TripSite = new List<TripSite>();
            //    site.TripSite.Add(TripSiteToDB(ts));
            //}
            return(site);
        }
Beispiel #2
0
        /****************EquipmentSite***********************/
        public static EquipmentSites EquipmentSiteToDB(CommonEquipmentSite commonEquipmentSite)
        {
            EquipmentSites EquipmentSite = new EquipmentSites()
            {
                EquipmentId = commonEquipmentSite.EquipmentId,
                SiteId      = commonEquipmentSite.SiteId
                              //Sites = SiteToDB(commonEquipmentSite.Sites),
                              //Equipment = EquipmentToDB(commonEquipmentSite.Equipment)
            };

            return(EquipmentSite);
        }
Beispiel #3
0
        public static CommonEquipmentSite EquipmentSiteToCommon(EquipmentSites equipmentSite)
        {
            CommonEquipmentSite commonEquipmentSite = new CommonEquipmentSite()
            {
                EquipmentId = equipmentSite.EquipmentId,
                SiteId      = equipmentSite.SiteId
                              //Sites = SiteToCommon(equipmentSite.Sites),
                              //Equipment = EquipmentToCommon(equipmentSite.Equipment)
            };

            return(commonEquipmentSite);
        }