private string _CreateHtmlForShowingPackage(LoanProduct pPackage)
        {
            string img = "package.png";

            if (pPackage.Delete)
            {
                img = "package_delete.png";
            }

            string packageAnticipatedTotalRepaymentPenaltiesBase = pPackage.AnticipatedTotalRepaymentPenaltiesBase ==
                                                                   OAnticipatedRepaymentPenaltiesBases.RemainingOLB
                                                                  ? GetString("RemainingOLB.Text")
                                                                  : GetString("RemainingInterest.Text");

            string packageLateFeesInitialAmount = pPackage.NonRepaymentPenalties.InitialAmount.HasValue
                                                      ? ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenalties.InitialAmount.Value, true) + "%"
                                                      : string.Format(GetString("Between.Text"),
                                                                      ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenaltiesMin.InitialAmount.Value, true),
                                                                      ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenaltiesMax.InitialAmount.Value, true),
                                                                      "%");

            string packageLateFeesOLB = pPackage.NonRepaymentPenalties.OLB.HasValue
                                            ? ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenalties.OLB.Value, true) + "%"
                                            : string.Format(GetString("Between.Text"),
                                                            ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenaltiesMin.OLB.Value, true),
                                                            ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenaltiesMax.OLB.Value, true),
                                                            "%");

            string packageLateFeesOverduePrincipal = pPackage.NonRepaymentPenalties.OverDuePrincipal.HasValue
                                                         ? ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenalties.OverDuePrincipal.Value, true) + "%"
                                                         : string.Format(GetString("Between.Text"),
                                                                         ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenaltiesMin.OverDuePrincipal.Value, true),
                                                                         ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenaltiesMax.OverDuePrincipal.Value, true),
                                                                         "%");

            string packageLateFeesOverdueInterest = pPackage.NonRepaymentPenalties.OverDueInterest.HasValue
                                                        ? ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenalties.OverDueInterest.Value, true) + "%"
                                                        : string.Format(GetString("Between.Text"),
                                                                        ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenaltiesMin.OverDueInterest.Value, true),
                                                                        ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenaltiesMax.OverDueInterest.Value, true),
                                                                        "%");

            string packageInterestRate = pPackage.InterestRate.HasValue
                                             ? ServicesHelper.ConvertNullableDecimalToString(pPackage.InterestRate, true) + "%"
                                             : string.Format(GetString("Between.Text"),
                                                             ServicesHelper.ConvertNullableDecimalToString(pPackage.InterestRateMin, true),
                                                             ServicesHelper.ConvertNullableDecimalToString(pPackage.InterestRateMax, true),
                                                             "%");

//            string packageEntryFees = pPackage.EntryFees.HasValue
//                                          ? ServicesHelper.ConvertNullableDoubleToString(pPackage.EntryFees, pPackage.EntryFeesPercentage) + entryFeesUnits
//                                          : string.Format(MultiLanguageStrings.GetString(Ressource.PackagesForm, "Between.Text"),
//                                                          ServicesHelper.ConvertNullableDoubleToString(pPackage.EntryFeesMin, pPackage.EntryFeesPercentage),
//                                                          ServicesHelper.ConvertNullableDoubleToString(pPackage.EntryFeesMax, pPackage.EntryFeesPercentage),
//                                                          entryFeesUnits);

            string packageAnticipatedRepaymentPenalties = pPackage.AnticipatedTotalRepaymentPenalties.HasValue
                                                              ? ServicesHelper.ConvertNullableDoubleToString(pPackage.AnticipatedTotalRepaymentPenalties, true) + "%"
                                                              : string.Format(GetString("Between.Text"),
                                                                              ServicesHelper.ConvertNullableDoubleToString(pPackage.AnticipatedTotalRepaymentPenaltiesMin, true),
                                                                              ServicesHelper.ConvertNullableDoubleToString(pPackage.AnticipatedTotalRepaymentPenaltiesMax, true),
                                                                              "%");

            string packageNbOfInstallment = pPackage.NbOfInstallments.HasValue
                                                ? pPackage.NbOfInstallments.Value + " " + GetString("Periods.Text")
                                                : string.Format(GetString("Between.Text"),
                                                                pPackage.NbOfInstallmentsMin.Value,
                                                                pPackage.NbOfInstallmentsMax.Value,
                                                                GetString("Periods.Text"));

            string packageGracePeriod = pPackage.GracePeriod.HasValue
                                            ? pPackage.GracePeriod.Value + " " + GetString("Periods.Text")
                                            : string.Format(GetString("Between.Text"),
                                                            pPackage.GracePeriodMin.Value,
                                                            pPackage.GracePeriodMax.Value,
                                                            GetString("Periods.Text"));
            string packageCurrency = pPackage.Currency.Name;

            string text = string.Format(@"
                            <form id='{1}' name='package{1}'>
                            <table id={1} cellpadding='0' cellspacing='0' border='0' class='list_content' onclick='click_book(this,{1});' onmouseenter='mouse_enter_book(this);' onmouseleave='mouse_leave_book(this);'>
	                        <tr>
		                        <td>
                                    <table class='book_list' cellpadding='0' cellspacing='0' border='0'>
	                                <tr>
		                                <td>
			                                <table cellpadding='0' cellspacing='0' border='0'>
				                                <tr>
					                                <td><img id='{1}' src='{0}'/></td>
                                                </tr>                                                
			                                </table>
		                                </td>
	                                </tr>
                                    </table>
		                        </td>
		                        <td style='width:100%'>
		                            <span >
		                                <span class='title_popup'>{2}</span>
		                                <table cellpadding='0' cellspacing='0' border='0'>

                                        <tr>
		                                    <td>			
		                                        <span class='details'>"         + GetString("Currency.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{14}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
                                            <td>			
		                                        <span class='details'>"         + GetString("Anticipatedrepaymentpenalties.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{8}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
		                                    <td>			
		                                        <span class='details'>"         + GetString("Basedon.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{13}</span>
		                                    </td>
                                        </tr>
		                                <tr style='vertical-align:top'>
		                                    <td>
		                                        <table cellpadding='0' cellspacing='0' border = '0'>
                                                    <tr><td><span class='details'>" + GetString("Interestrate.Text") + @"</span></td></tr>
                                                    <tr><td><span class='details'>" + GetString("Periodicity.Text") + @"</span></td></tr>    
		                                            <tr><td><span class='details'>"         + GetString("Maturity.Text") + @"</span></td></tr>                                                    
		                                            <tr><td><span class='details'>"         + GetString("Graceperiod.Text") + @"</span></td></tr>
		                                        </table>
		                                    </td>
		                                    <td>
		                                        <table cellpadding='0' cellspacing='0' border = '0'>
                                                    <tr><td><span class='description'>&nbsp;&nbsp;{3}</span></td></tr>
                                                    <tr><td><span class='description'>&nbsp;&nbsp;{4}</span></td></tr>
		                                            <tr><td><span class='description'>&nbsp;&nbsp;{5}</span></td></tr>
		                                            <tr><td><span class='description'>&nbsp;&nbsp;{6}</span></td></tr>
		                                        </table>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
		                                    <td>			
		                                        <span class='details'>"         + GetString("Laterepaymentspenalties.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <table cellpadding='0' cellspacing='0' border = '0'>
		                                            <tr><td><span class='description'>&nbsp;&nbsp;{9}</span></td></tr>
		                                            <tr><td><span class='description'>&nbsp;&nbsp;{10}</span></td></tr>
		                                            <tr><td><span class='description'>&nbsp;&nbsp;{11}</span></td></tr>
		                                            <tr><td><span class='description'>&nbsp;&nbsp;{12}</span></td></tr>
		                                        </table>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
		                                    <td>
		                                        <table cellpadding='0' cellspacing='0' border = '0'>
		                                            <tr><td><span class='details'>"         + GetString("Basedon.Text") + @"</span></td></tr>
		                                            <tr><td><span class='details'>"         + GetString("Basedon.Text") + @"</span></td></tr>
		                                            <tr><td><span class='details'>"         + GetString("Basedon.Text") + @"</span></td></tr>
		                                            <tr><td><span class='details'>"         + GetString("Basedon.Text") + @"</span></td></tr>
		                                        </table>
		                                    </td>
		                                    <td>
		                                        <table cellpadding='0' cellspacing='0' border = '0'>
		                                            <tr><td><span class='description'>&nbsp;&nbsp;"         + GetString("Totalloanamount.Text") + @"</span></td></tr>
		                                            <tr><td><span class='description'>&nbsp;&nbsp;"         + GetString("OLB.Text") + @"</span></td></tr>
		                                            <tr><td><span class='description'>&nbsp;&nbsp;"         + GetString("Overdueprincipal.Text") + @"</span></td></tr>
		                                            <tr><td><span class='description'>&nbsp;&nbsp;"         + GetString("Overdueinterest.Text") + @"</span></td></tr>
		                                        </table>
		                                    </td>
		                                </tr>
		                                </table>
                                    </span>
                                </td>
                            </tr>
                            </table></form>", Path.Combine(UserSettings.GetTemplatePath, img), pPackage.Id, pPackage.Name, packageInterestRate,
                                        pPackage.InstallmentType.Name, packageNbOfInstallment, packageGracePeriod, 0 /*packageEntryFees*/,
                                        packageAnticipatedRepaymentPenalties, packageLateFeesInitialAmount, packageLateFeesOLB,
                                        packageLateFeesOverduePrincipal, packageLateFeesOverdueInterest, packageAnticipatedTotalRepaymentPenaltiesBase, packageCurrency);

            return(text);
        }
        private string _CreateHtmlForShowingPackage(SavingsBookProduct pSavingsProduct)
        {
            string img = "package.png";

            if (pSavingsProduct.Delete)
            {
                img = "package_delete.png";
            }

            string productInitialAmount = String.Format(GetString("Between.Text") + " {0} " + GetString("And.Text") + " {1}", pSavingsProduct.InitialAmountMin.GetFormatedValue(pSavingsProduct.UseCents), pSavingsProduct.InitialAmountMax.GetFormatedValue(pSavingsProduct.UseCents));
            string productBalance       = String.Format(GetString("Between.Text") + " {0} " + GetString("And.Text") + " {1}", pSavingsProduct.BalanceMin.GetFormatedValue(pSavingsProduct.UseCents), pSavingsProduct.BalanceMax.GetFormatedValue(pSavingsProduct.UseCents));
            string productWithdrawing   = String.Format(GetString("Between.Text") + " {0} " + GetString("And.Text") + " {1}", pSavingsProduct.WithdrawingMin.GetFormatedValue(pSavingsProduct.UseCents), pSavingsProduct.WithdrawingMax.GetFormatedValue(pSavingsProduct.UseCents));
            string productInterestRate  = pSavingsProduct.InterestRate.HasValue
                                             ? ServicesHelper.ConvertNullableDoubleToString(pSavingsProduct.InterestRate.Value, true) + "%"
                                             : string.Format(GetString("Between.Text") + " {0} " + GetString("And.Text") + " {1}%",
                                                             ServicesHelper.ConvertNullableDoubleToString(pSavingsProduct.InterestRateMin.Value, true),
                                                             ServicesHelper.ConvertNullableDoubleToString(pSavingsProduct.InterestRateMax.Value, true));
            string productDeposit   = String.Format(GetString("Between.Text") + " {0} " + GetString("And.Text") + " {1}", pSavingsProduct.DepositMin.GetFormatedValue(true), pSavingsProduct.DepositMax.GetFormatedValue(pSavingsProduct.UseCents));
            string productEntryFees = pSavingsProduct.EntryFees.HasValue
                                        ? pSavingsProduct.EntryFees.GetFormatedValue(pSavingsProduct.UseCents)
                                        : string.Format(GetString("Between.Text") + " {0} " + GetString("And.Text") + " {1}", pSavingsProduct.EntryFeesMin.GetFormatedValue(pSavingsProduct.UseCents), pSavingsProduct.EntryFeesMax.GetFormatedValue(pSavingsProduct.UseCents));

            string productInterestBase             = GetString(pSavingsProduct.InterestBase.ToString() + ".Text");
            string productInterestFrequency        = GetString(pSavingsProduct.InterestFrequency.ToString() + ".Text");
            string productInterestCalculAmountBase = pSavingsProduct.CalculAmountBase.HasValue ? GetString(pSavingsProduct.CalculAmountBase.ToString() + ".Text") : "-----";
            string productTransfer = String.Format(GetString("Between.Text") + " {0} " + GetString("And.Text") + " {1}", pSavingsProduct.TransferMin.GetFormatedValue(pSavingsProduct.UseCents), pSavingsProduct.TransferMax.GetFormatedValue(pSavingsProduct.UseCents));

            string text = string.Format(@"
                            <form id='{1}' name='package{1}'>
                            <table id={1} cellpadding='0' cellspacing='0' border='0' class='list_content' onclick='click_book(this,{1});' onmouseenter='mouse_enter_book(this);' onmouseleave='mouse_leave_book(this);'>
	                        <tr>
		                        <td>
                                    <table class='book_list' cellpadding='0' cellspacing='0' border='0'>
	                                <tr>
		                                <td>
			                                <table cellpadding='0' cellspacing='0' border='0'>
				                                <tr>
					                                <td><img id='{1}' src='{0}'/></td>
                                                </tr>                                                
			                                </table>
		                                </td>
	                                </tr>
                                    </table>
		                        </td>
		                        <td style='width:100%'>
		                            <span >
		                                <span class='title_popup'>"         + GetString("SavingBookProduct.Text") + @" : {2} ({13})</span>
		                                <table cellpadding='0' cellspacing='0' border='0'>
		                                <tr>
		                                    <td>			
		                                        <span class='details'>"         + GetString("InitialAmount.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{3}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
		                                    <td>			
		                                        <span class='details'>"         + GetString("Balance.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{4}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
		                                    <td>			
		                                        <span class='details'></span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;</span>
		                                    </td>
		                                </tr>
		                                <tr>
		                                    <td>			
		                                        <span class='details'>"         + GetString("Withdrawing.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{5}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
		                                    <td>			
		                                        <span class='details'>"         + GetString("InterestRate.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{6}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
		                                    <td>			
		                                        <span class='details'></span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;</span>
		                                    </td>
		                                </tr>
		                                <tr>
		                                    <td>			
		                                        <span class='details'>"         + GetString("Deposit.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{7}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
	                                        <td>			
		                                        <span class='details'>"         + GetString("InterestFrequency.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{8}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
		                                    <td colspan='5'></td>
		                                </tr>
                                        <tr>
		                                    <td>			
		                                        <span class='details'>"         + GetString("InterestBase.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{9}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
                                            <td>			
		                                        <span class='details'>"         + GetString("BasedOn.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{10}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
		                                    <td colspan='5'></td>
		                                </tr>
                                        <tr>
                                            <td>			
		                                        <span class='details'>"         + GetString("Transfer.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{11}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
		                                    <td>			
		                                        <span class='details'>"         + GetString("EntryFees.Text") + @"</span> 
		                                    </td>
		                                    <td>
		                                        <span class='description'>&nbsp;&nbsp;{12}</span>
		                                    </td>
                                            <td><span style='margin-left:15px;'></span></td>
                                            <td colspan='8'>			
		                                    </td>
		                                </tr>
		                                </table>
                                    </span>
                                </td>
                            </tr>
                            </table></form>", Path.Combine(UserSettings.GetTemplatePath, img),
                                        pSavingsProduct.Id, pSavingsProduct.Name, productInitialAmount, productBalance,
                                        productWithdrawing, productInterestRate, productDeposit, productInterestFrequency,
                                        productInterestBase, productInterestCalculAmountBase, productTransfer, productEntryFees, pSavingsProduct.Code);

            return(text);
        }