Beispiel #1
0
        public static void SavePartialPriceListModel(string id, List <SpecialPrices> partModelList)
        {
            var manager   = PlugInManager.GetPriceListManager();
            var pricelist = manager.GetPriceList(id);

            pricelist.SpecialPricesList = partModelList;
            manager.UpdatePriceList(pricelist);
        }
Beispiel #2
0
        public static void SavePartialPriceListModel(string id, List <SeasonUnitCondition> partModelList)
        {
            var manager   = PlugInManager.GetPriceListManager();
            var pricelist = manager.GetPriceList(id);

            pricelist.ConditionsList = partModelList;
            manager.UpdatePriceList(pricelist);
        }
Beispiel #3
0
        public static void SavePartialPriceListModel(string id, List <SeasonUnitAvailability> partModelList)
        {
            var manager   = PlugInManager.GetPriceListManager();
            var pricelist = manager.GetPriceList(id);

            pricelist.AvailabilityList = partModelList;
            manager.UpdatePriceList(pricelist);
        }
Beispiel #4
0
        public static void ReplacePriceList(IdomOffice.Interface.BackOffice.PriceLists.PriceList priceList, string targetPriceListId, decimal factor)
        {
            var manager         = PlugInManager.GetPriceListManager();
            var targetPriceList = manager.GetPriceList(targetPriceListId);

            targetPriceList.ActionsList      = priceList.ActionsList;
            targetPriceList.AvailabilityList = priceList.AvailabilityList;
            targetPriceList.ConditionsList   = priceList.ConditionsList;
            targetPriceList.PaymentModeList  = priceList.PaymentModeList;
            targetPriceList.ServicesList     = priceList.ServicesList;
            targetPriceList.SeasonPriceList  = priceList.SeasonPriceList;

            if (factor > 0)
            {
                foreach (var pr in targetPriceList.SeasonPriceList)
                {
                    pr.Eur = pr.Eur * factor;
                }
            }
            manager.UpdatePriceList(targetPriceList);
        }
Beispiel #5
0
        public static IdomOffice.Interface.BackOffice.PriceLists.PriceList GetPriceList(string id)
        {
            var manager = PlugInManager.GetPriceListManager();

            return(manager.GetPriceList(id));
        }
Beispiel #6
0
        public static List <PriceListModel> GetAll()
        {
            var manager = PlugInManager.GetPriceListManager();

            List <IdomOffice.Interface.BackOffice.PriceLists.PriceList> list = new List <IdomOffice.Interface.BackOffice.PriceLists.PriceList>();

            List <PriceListModel> pricelist = new List <PriceListModel>();

            list = manager.GetPriceLists();

            foreach (var priceList in list)
            {
                PriceListModel model = new PriceListModel();
                model.id        = priceList.id;
                model.SiteCode  = priceList.SiteCode;
                model.OfferCode = priceList.OfferCode;
                //          model.UnitCode = priceList.UnitCode;
                model.PriceListType     = priceList.PriceListType;
                model.TourOperatorCode  = priceList.TourOperatorCode;
                model.SeasonPriceList   = priceList.SeasonPriceList;
                model.ActionsList       = priceList.ActionsList;
                model.AvailabilityList  = priceList.AvailabilityList;
                model.ConditionsList    = priceList.ConditionsList;
                model.PaymentModeList   = priceList.PaymentModeList;
                model.ServicesList      = priceList.ServicesList;
                model.SpecialPricesList = priceList.SpecialPricesList;

                var masterDataManager = PlugInManager.GetMasterDataManager();
                var offer             = masterDataManager.GetUnitOffer(priceList.TourOperatorCode, priceList.SiteCode, priceList.OfferCode);
                var unit = masterDataManager.GetTouristUnit(priceList.SiteCode, offer.UnitCode);
                if (unit != null)
                {
                    model.SiteName = unit.SiteName;
                    model.UnitName = unit.UnitTitel;
                }
                int counter = 0;
                foreach (var item in model.SeasonPriceList)
                {
                    item.Id = (++counter).ToString();
                }
                counter = 0;
                foreach (var item in model.SpecialPricesList)
                {
                    item.Id = (++counter).ToString();
                }
                counter = 0;
                foreach (var item in model.ActionsList)
                {
                    item.Id = (++counter).ToString();
                }
                counter = 0;
                foreach (var item in model.AvailabilityList)
                {
                    item.Id = (++counter).ToString();
                }
                counter = 0;
                foreach (var item in model.ConditionsList)
                {
                    item.Id = (++counter).ToString();
                }
                counter = 0;
                foreach (var item in model.PaymentModeList)
                {
                    item.Id = (++counter).ToString();
                }
                counter = 0;
                foreach (var item in model.ServicesList)
                {
                    item.Id = (++counter).ToString();
                }

                pricelist.Add(model);
            }
            return(pricelist);
        }
Beispiel #7
0
        public static PriceListModel GetModel(string tourOperatorCode, string siteCode, string offerCode, PriceListType priceTyp)
        {
            PriceListModel model = new PriceListModel();

            var manager   = PlugInManager.GetPriceListManager();
            var priceList = manager.GetPriceList(tourOperatorCode, siteCode, offerCode, priceTyp);

            if (priceList == null)
            {
                priceList    = new IdomOffice.Interface.BackOffice.PriceLists.PriceList();
                priceList.id = Guid.NewGuid().ToString();
                priceList.TourOperatorCode = tourOperatorCode;
                priceList.SiteCode         = siteCode;
                priceList.OfferCode        = offerCode;
                priceList.PriceListType    = priceTyp;
                manager.AddPriceList(priceList);
            }

            // sada kreiramo model
            model           = new PriceListModel();
            model.id        = priceList.id;
            model.SiteCode  = priceList.SiteCode;
            model.OfferCode = priceList.OfferCode;
            //      model.UnitCode = priceList.UnitCode;
            model.PriceListType     = priceList.PriceListType;
            model.TourOperatorCode  = priceList.TourOperatorCode;
            model.SeasonPriceList   = priceList.SeasonPriceList;
            model.ActionsList       = priceList.ActionsList;
            model.AvailabilityList  = priceList.AvailabilityList;
            model.ConditionsList    = priceList.ConditionsList;
            model.PaymentModeList   = priceList.PaymentModeList;
            model.ServicesList      = priceList.ServicesList;
            model.SpecialPricesList = priceList.SpecialPricesList;

            var masterDataManager = PlugInManager.GetMasterDataManager();
            var offer             = masterDataManager.GetUnitOffer(tourOperatorCode, siteCode, offerCode);
            var unit = masterDataManager.GetTouristUnit(siteCode, offer.UnitCode);

            model.SiteName = unit.SiteName;
            model.UnitName = unit.UnitTitel;
            int counter = 0;

            foreach (var item in model.SeasonPriceList)
            {
                item.Id = (++counter).ToString();
            }
            List <SeasonAndPrice> season = model.SeasonPriceList;

            season = season.OrderBy(m => m.FromDate).ToList();
            model.SeasonPriceList = season;
            counter = 0;
            foreach (var item in model.SpecialPricesList)
            {
                item.Id = (++counter).ToString();
            }
            counter = 0;
            foreach (var item in model.ActionsList)
            {
                item.Id = (++counter).ToString();
            }
            counter = 0;
            foreach (var item in model.AvailabilityList)
            {
                item.Id = (++counter).ToString();
            }
            counter = 0;
            foreach (var item in model.ConditionsList)
            {
                item.Id = (++counter).ToString();
            }
            counter = 0;
            foreach (var item in model.PaymentModeList)
            {
                item.Id = (++counter).ToString();
            }
            counter = 0;
            foreach (var item in model.ServicesList)
            {
                item.Id = (++counter).ToString();
            }


            return(model);
        }
Beispiel #8
0
        public static IdomOffice.Interface.BackOffice.PriceLists.PriceList GetPriceList(string tourOperatorCode, string siteCode, string offerCode, PriceListType priceTyp)
        {
            var manager = PlugInManager.GetPriceListManager();

            return(manager.GetPriceList(tourOperatorCode, siteCode, offerCode, priceTyp));
        }