using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CodeCafe.Web;
public partial class View_Invoice : System.Web.UI.Page
{
/****************************************************************************************************/
///
/// Handles the Load event of the Page control.
///
/// The source of the event.
/// The instance containing the event data.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int idx = Utils.StrToIntDef(Request["id_admin"], 0);
if (idx == 0)
{
clsShoppingBasket basket = new clsShoppingBasket();
idx = basket.InvoiceID;
}
ShowInvoiceDetails(idx);
}
}
/****************************************************************************************************/
///
/// Shows the invoice details.
///
/// The order ID.
private void ShowInvoiceDetails(int OrderID)
{
if (OrderID > 0)
{
ltReference.Text = "BW" + OrderID.ToString("00000");
clsUserInfo user = new clsUserInfo();
clsShoppingBasket basket = new clsShoppingBasket();
basket.Load(OrderID);
user.Load(basket.ui_id);
ltDetails.Text = user.RenderInvoiceDetails();
clsBasketItem items = new clsBasketItem();
ltOrder.Text = items.ListForEmail(OrderID, true);
if (items.IsRecurringPayment)
{
ltMonthly.Text += Global.RecurringPaymentInfo(basket.sb_date, items.MaxTerm);
//DateTime Payment = new DateTime(basket.sb_date.AddMonths(1).Year, basket.sb_date.AddMonths(1).Month, 1);
//ltMonthly.Text = "
Your first monthly payment will reflect immediately, subsequent payments will reflect on the 1st of each month starting from
";
//ltMonthly.Text += "1st " + Payment.ToString("MMMM yyyy") + " until 1st " + Payment.AddMonths(items.MaxTerm - 2).ToString("MMMM yyyy") + "";
}
}
else
ltOrder.Text = "Invalid order selected!";
}
/****************************************************************************************************/
}