public PostingInterestsStrategy(ISavingsContract pSaving, User pUser, int pWeekEndDay2)
 {
     if (((SavingBookContract)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfYear)
         _ipi = new Posting.EndOfYear(pSaving, pUser);
     else if (((SavingBookContract)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfMonth)
         _ipi = new Posting.EndOfMonth((SavingBookContract)pSaving, pUser);
     else if (((SavingBookContract)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfWeek)
         _ipi = new Posting.EndOfWeek((SavingBookContract)pSaving, pUser, pWeekEndDay2);
     else if (((SavingBookContract)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfDay ||
                ((SavingBookContract)pSaving).UseTermDeposit
                 )
         _ipi = new Posting.PostingMethods((SavingBookContract)pSaving, pUser);
 }
 public PostingInterestsStrategy(ISavingsContract pSaving, User pUser, int pWeekEndDay2)
 {
     if (pSaving is Saving)
     {
         if (((Saving)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfYear)
             _ipi = new Posting.EndOfYear(pSaving, pUser);
         else if (((Saving)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfMonth)
             _ipi = new Posting.EndOfMonth((Saving)pSaving, pUser);
         else if (((Saving)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfWeek)
             _ipi = new Posting.EndOfWeek((Saving)pSaving, pUser, pWeekEndDay2);
         else if (((Saving)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfDay)
             _ipi = new Posting.EndOfDay((Saving)pSaving, pUser);
     }
     else if (pSaving is SavingDeposit)
     {
         _ipi = new Posting.Maturity((SavingDeposit)pSaving, pUser);
     }
 }
 public PostingInterestsStrategy(ISavingsContract pSaving, User pUser, int pWeekEndDay2)
 {
     if (((SavingBookContract)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfYear)
     {
         _ipi = new Posting.EndOfYear(pSaving, pUser);
     }
     else if (((SavingBookContract)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfMonth)
     {
         _ipi = new Posting.EndOfMonth((SavingBookContract)pSaving, pUser);
     }
     else if (((SavingBookContract)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfWeek)
     {
         _ipi = new Posting.EndOfWeek((SavingBookContract)pSaving, pUser, pWeekEndDay2);
     }
     else if (((SavingBookContract)pSaving).Product.InterestFrequency == OSavingInterestFrequency.EndOfDay ||
              ((SavingBookContract)pSaving).UseTermDeposit
              )
     {
         _ipi = new Posting.PostingMethods((SavingBookContract)pSaving, pUser);
     }
 }