public void DevCreatePriceListSeriesApplicaiton() { Pages.Home_Page.EntePriceListTab(); PriceListCreateNew.ClickOn(); PriceListCode.EnterText(Constant.priceListCode + RandomNumber.smallNumber()); PriceListName.EnterText(Constant.priceListName + RandomNumber.smallNumber()); Thread.Sleep(500); PriceListType.ClickOn(); PriceListType.SendKeys(Keys.ArrowDown); PriceListType.SendKeys(Keys.ArrowDown); PriceListType.SendKeys(Keys.Enter); utility.SelectCodeOnCodeBroswer("//*[@id='gridCodeBrowser']/div[2]/table/tbody/tr[1]/td[5]/div/input"); PriceListSaveDev.ClickOn(); PriceListSaveDev.ClickOn(); softAssert.VerifySuccessMsg(); softAssert.VerifyElementHasEqual(utility.TableCount(priceListTableCount), Constant.tmpTableCount + 1); }
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); }
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)); }
protected void btnAdd_Click(object sender, EventArgs e) { Uri u = HttpContext.Current.Request.Url; string to = HttpUtility.ParseQueryString(u.Query).Get("to"); string sc = HttpUtility.ParseQueryString(u.Query).Get("sc"); string uc = HttpUtility.ParseQueryString(u.Query).Get("uc"); string oc = HttpUtility.ParseQueryString(u.Query).Get("oc"); string plt = HttpUtility.ParseQueryString(u.Query).Get("plt"); PriceListType targetpricetype = (PriceListType)Enum.Parse(typeof(PriceListType), plt, true); string sitecode = comboboxSiteCode.SelectedItem == null ? string.Empty: comboboxSiteCode.SelectedItem.Text; // string unitcode = comboboxUnitCode.SelectedItem==null ? string.Empty: comboboxUnitCode.SelectedItem.Text; string offercode = comboboxOfferCode.SelectedIndex < 0 ? null : comboboxOfferCode.SelectedItem.Text; string pricelisttype = comboboxPriceListType.SelectedItem == null ? string.Empty : comboboxPriceListType.SelectedItem.Text; PriceListType pricetype = (PriceListType)Enum.Parse(typeof(PriceListType), pricelisttype, true); string faktor = txtFaktor.Text; decimal faktorvalue = Decimal.Parse(txtFaktor.Text); pricecontroller.CopyPriceList(to, sitecode, offercode, pricetype, sc, uc, oc, targetpricetype, faktorvalue); //model = pricecontroller.GetModel(sitecode, unitcode, offercode, pricetype); //string id = model.id; //List<SeasonAndPrice> SeasonPrice = new List<SeasonAndPrice>(); //List<SeasonUnitAvailability> Availability = new List<SeasonUnitAvailability>(); //List<SeasonUnitAction> Actions= new List<SeasonUnitAction>(); //List<SeasonUnitCondition> Conditions = new List<SeasonUnitCondition>(); //List<SeasonUnitService> Services = new List<SeasonUnitService>(); //List<PaymentMode> PaymentMode = new List<PaymentMode>(); //List<SpecialPrices> SpecialPrices = new List<SpecialPrices>(); //var price = model.SeasonPriceList; //SeasonPrice = model.SeasonPriceList; //Availability = model.AvailabilityList; //Actions = model.ActionsList; //Conditions = model.ConditionsList; //Services = model.ServicesList; //PaymentMode = model.PaymentModeList; //SpecialPrices = model.SpecialPricesList; //if(model.SeasonPriceList.Count>0) //{ // var prices = GetPrices(price, faktorvalue); // SeasonPrice.AddRange(prices); //} //if(model.AvailabilityList.Count>0) //{ // Availability.AddRange(model.AvailabilityList); //} //if(model.ActionsList.Count>0) //{ // Actions.AddRange(model.ActionsList); //} //if(model.ConditionsList.Count>0) //{ // Conditions.AddRange(model.ConditionsList); //} //if(model.ServicesList.Count>0) //{ // Services.AddRange(model.ServicesList); //} //if(model.PaymentModeList.Count>0) //{ // PaymentMode.AddRange(model.PaymentModeList); //} //if(model.SpecialPricesList.Count>0) //{ // SpecialPrices.AddRange(model.SpecialPricesList); //} //pricecontroller.SavePartialModelSeasonAndPrice(id, SeasonPrice); //pricecontroller.SavePartialModelSeasonUnitAction(id, Actions); //pricecontroller.SavePartialModelSeasonUnitAvailability(id, Availability); //pricecontroller.SavePartialModelSeasonUnitCondition(id, Conditions); //pricecontroller.SavePartialModelSeasonUnitService(id, Services); //pricecontroller.SavePartialModelSpecialPrices(id, SpecialPrices); //pricecontroller.SavePartialModelPaymentMode(id, PaymentMode); }
public PriceList GetPriceList(string TourOperatorCode, string SiteCode, string OfferCode, PriceListType priceListType) { return(collectionPriceList.Find(m => m.TourOperatorCode == TourOperatorCode && m.SiteCode == SiteCode && m.OfferCode == OfferCode && m.PriceListType == priceListType).FirstOrDefault()); }
public PriceInformation GetPricesRequisition(DateTimeOffset startAt, DateTimeOffset endAt, DateTimeOffset originStartAt, DateTimeOffset originEndAt, CompetenceLevel competenceLevel, PriceListType listType, int rankingId, out bool useRequestPricerows, int?timeWasteNormalTime, int?timeWasteIWHTime, IEnumerable <PriceRowBase> requestPriceRows, decimal?outlay, Order replacingOrder, DateTimeOffset orderCreatedDate, List <MealBreak> mealbreaks = null) { var prices = GetPriceList(startAt, competenceLevel, listType); //get mealbeaks if any IDictionary <PriceListRowType, int> mealbreakTimes = GetMealBreakTimesAndTypes(mealbreaks); //compare compensation for origin times with requisition times (including mealbreaks), broker/interpreter should have the compensation that get most payed var pricesRequisition = MergePriceListRowsAndReduceForMealBreak(GetPriceRowsPerType(startAt, endAt, prices, mealbreaks), mealbreakTimes); var pricesOriginTimes = MergePriceListRowsAndReduceForMealBreak(GetPriceRowsPerType(originStartAt, originEndAt, prices, mealbreaks), mealbreakTimes); useRequestPricerows = UsePricesOriginTimes(pricesRequisition, pricesOriginTimes); //if we should use request, set start and end from request start and end var pricesToUse = useRequestPricerows ? pricesOriginTimes.ToList() : pricesRequisition.ToList(); //if replacementorder - check and compare start- and endtime from replacing order if (replacingOrder != null) { var pricesReplacingOrder = MergePriceListRowsAndReduceForMealBreak(GetPriceRowsPerType(replacingOrder.StartAt, replacingOrder.EndAt, prices, mealbreaks), mealbreakTimes); bool useReplacingOrderTimes = UsePricesOriginTimes(useRequestPricerows ? pricesOriginTimes : pricesRequisition, pricesReplacingOrder); if (useReplacingOrderTimes) { pricesToUse = pricesReplacingOrder.ToList(); useRequestPricerows = useReplacingOrderTimes; } } //get lost time and extra charges pricesToUse.AddRange(GetLostTimePriceRows(startAt, timeWasteNormalTime, timeWasteIWHTime, prices)); return(CompletePricesWithExtraCharges(startAt, endAt, competenceLevel, pricesToUse, rankingId, null, orderCreatedDate, outlay, requestPriceRows.Single(rpr => rpr.PriceRowType == PriceRowType.BrokerFee))); }
public PriceInformation GetPrices(DateTimeOffset startAt, DateTimeOffset endAt, CompetenceLevel competenceLevel, PriceListType listType, int rankingId, DateTimeOffset orderCreatedDate, decimal?travelCost = null) { var prices = GetPriceList(startAt, competenceLevel, listType); return(CompletePricesWithExtraCharges(startAt, endAt, competenceLevel, MergePriceListRowsAndReduceForMealBreak(GetPriceRowsPerType(startAt, endAt, prices)).ToList(), rankingId, travelCost, orderCreatedDate)); }
public List <PriceListRow> GetPriceList(DateTimeOffset startAt, CompetenceLevel competenceLevel, PriceListType listType) { return(_dbContext.PriceListRows.Where(r => r.CompetenceLevel == competenceLevel && r.PriceListType == listType && r.StartDate.Date <= startAt.Date && r.EndDate.Date >= startAt.Date).ToList()); }
public PriceList GetPriceList(string SiteCode, string UnitCode, string OfferCode, PriceListType priceListType) { if (priceListType == PriceListType.PurchasePrice) { return(collectionPriceList.Find(m => m.SiteCode == SiteCode && m.UnitCode == UnitCode).FirstOrDefault()); } return(collectionPriceList.Find(m => m.SiteCode == SiteCode && m.OfferCode == OfferCode && m.UnitCode == UnitCode).FirstOrDefault()); }
public PriceList GetPriceList(string SiteCode, string UnitCode, PriceListType priceListType) { return(collectionPriceList.Find(m => m.SiteCode == SiteCode && m.UnitCode == UnitCode).FirstOrDefault()); }
public string GetPriceListId(string touroperator, string siteCode, string offerCode, PriceListType pType) { return(PriceListRepository.GetModel(touroperator, siteCode, offerCode, pType).id); }
public void CopyPriceList(string touroperator, string sourceSiteCode, string sourceOfferCode, PriceListType sourcePriceListType, string targetSiteCode, string targetUitCode, string targetOfferCode, PriceListType targetPriceListType, decimal factor) { //uzmi cijene koje treba da budu kopirane var sourcePriceList = PriceListRepository.GetPriceList(touroperator, sourceSiteCode, sourceOfferCode, sourcePriceListType); //uzmi id od cjenovnika u koji treba da bude kopirano string targetId = PriceListRepository.GetPriceList(touroperator, targetSiteCode, targetOfferCode, targetPriceListType).id; //kopiraj cjene u aktuelni cjenovnik PriceListRepository.ReplacePriceList(sourcePriceList, targetId, factor); }
public PriceListModel GetModel(string tourOperatorCode, string siteCode, string offerCode, PriceListType pType) { return(PriceListRepository.GetModel(tourOperatorCode, siteCode, offerCode, pType)); }