0% found this document useful (0 votes)
16 views3 pages

Create B2 Page with Stay Conditions

The method creates a B2 page by loading a model with contract and rate data and setting it as the data source for the blank B2 page user control. It retrieves various data like units, boards, seasons from the contract. It then loops through periods merging them with stay conditions to generate B2 page records with minimum stay values, and adds them to the list of B2 pages if the minimum stay is greater than 0. Finally it sets the B2 page control's data source to this list.

Uploaded by

olgutza_ivan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

Create B2 Page with Stay Conditions

The method creates a B2 page by loading a model with contract and rate data and setting it as the data source for the blank B2 page user control. It retrieves various data like units, boards, seasons from the contract. It then loops through periods merging them with stay conditions to generate B2 page records with minimum stay values, and adds them to the list of B2 pages if the minimum stay is greater than 0. Finally it sets the B2 page control's data source to this list.

Uploaded by

olgutza_ivan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

private void CreateB2Page(bool bFill) { if (!bFill) return; B2PagePresenter B2Presenter = new B2PagePresenter(); [Link]([Link](), [Link], [Link]); if ([Link].

Count > 0) [Link]([Link].B2Page, highLightColor); [Link] = [Link]; } ///////////////////////////////////////// MinimumStay //private void CreateB2PageOld(TPAExtension tpa, bool bFill) //{ // if (!bFill) // return; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // [Link].ucBlankB2Page.listOfB2Page = new BindingList<B2Page>(); BindingList<BasicRateApplyDim> blBasicRateDim = [Link]([Link]()); DefaultPeriodBindingList pblPeriods = new DefaultPeriodBindingList([Link]()); Release relMinimumStay = null; ReleaseList lstReleases = new ReleaseList([Link]()); int iMinStayIndex = [Link]<Release>(lstReleases, "ReleaseType", [Link]); if (iMinStayIndex >= 0) relMinimumStay = lstReleases[iMinStayIndex]; BasicRateList arBasicRates = new BasicRateList([Link](), blBasicRateDim); Dictionary<string, string> dctUnitBoards = FillUnitBoards(arBasicRates); List<string> lstBoards = FillBoardList(); List<string> lstSeasons = FillSeasonList(pblPeriods); [Link](dctUnitBoards); [Link](lstBoards); [Link](lstSeasons); [Link] = [Link]().[Link](); [Link] = [Link]().[Link](); if ([Link]().[Link] == 0) { [Link] = [Link].ucBlankB2Page.listOfB2Page; return; } SortedList<DateTime, Object[]> sourcePeriods = CreateSourcePeriodsFromContractSeasons(); List<String> unitList = new List<String>(); if (IsStayConditionPerUnit("MinStay")) { foreach (BasicRate basicRate in arBasicRates) { [Link]([Link]); } } else

// // // // // // // //

{ [Link]("*"); } int iRow = 0; Hashtable hashDuplicates = new Hashtable(); foreach (String unitCode in unitList) { SortedList<DateTime, Object[]> periods2Merge = CreateStayConditionPeriodsFromContract(unitCode, "MinStay");

// //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // SortedList<DateTime, Object[]> list = MergeSeasons4(sourcePeriods, periods2Merge); // //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // //foreach (Object[] objPeriodNew in [Link]) // //{ // // foreach (Season season in [Link]().SubSeasons()) // // { // // Period period = (Period)objPeriodNew[0]; // // foreach (Period seasonPeriod in [Link]) // // { // // if ([Link]() >= [Link]() && [Link]() <= [Link]()) // // objPeriodNew[1] = season; // // // // // // // // // // // // // // // // // // // } // } //} //foreach (Object[] objPeriodNew in [Link]) //{ // Period period = (Period)objPeriodNew[0]; // foreach (StayConditionLine stayConditionLine in [Link]().StayConditionLines) // { // if ([Link]() == [Link]()) // { // objPeriodNew[1] = stayConditionLine; // } // } //} //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ foreach (Object[] objPeriod in [Link]) { Period period = (Period)objPeriod[0];

// String strKey = unitCode + [Link]().ToString(GERMAN_DATE_LONG) + [Link]().ToString(GERMAN_DATE_LONG); // if ([Link](strKey)) // continue; // // // // // // // [Link](strKey, strKey); B2Page b2Page = new B2Page(iRow++); [Link] = [Link](); [Link] = [Link](); [Link] = unitCode; if (objPeriod[1] is StayConditionLine) // Exceptional Maximumstay {

// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //}

StayConditionLine stayCondition = (StayConditionLine)objPeriod[1]; //[Link] = dctUnitBoards[[Link]]; [Link] = "*"; uint days = RetrieveExceptionStayRestrictionForUnit(unitCode, stayCondition, 1); [Link] = days; } else // default Season Maximum Stay { if (objPeriod[1] is int) { [Link] = "*"; //[Link] = [Link]; [Link] = ""; // According to REWE always Blank [Link] = ((uint)(int)objPeriod[1]); } else { Season season = (Season)objPeriod[1]; //[Link] = "*"; [Link] = "*"; //[Link] = [Link]; [Link] = ""; // According to REWE always Blank foreach (StayConditionLine stayCondition in [Link]().StayConditionLines) { if ([Link] != null && [Link]([Link])) { [Link] = Convert.ToUInt32([Link]()); break; } } } } // we need to find duplicates which are lost if we have two items with the same period StayConditionLine stayContition = FindExceptionalStayRestrictionByPeriod(period); if (stayContition != null && [Link]() > 0) { [Link] = Convert.ToUInt32([Link]()); } if ([Link] > 0) { [Link](b2Page); } else iRow--; } } [Link] = [Link]().[Link](); [Link] = [Link]().[Link](); [Link] = [Link].ucBlankB2Page.listOfB2Page; if ([Link] > 0) [Link]([Link].B2Page, highLightColor);

You might also like