Esempio n. 1
0
    protected void Display_View()
    {
        pnl_viewall.Visible = false;
        List<OrderData> orderList = new List<OrderData>();
        List<AddressData> aAddreses = new List<AddressData>();
        List<Ektron.Cms.Commerce.Basket> basketList;

        OrderApi orderApi = new OrderApi();
        BasketApi basketApi = new BasketApi();
        // customer
        cCustomer = CustomerManager.GetItem(this.m_iID);
        m_iCustomerId = cCustomer.Id;
        this.ltr_id.Text = cCustomer.Id.ToString();
        this.ltr_uname.Text = cCustomer.UserName;
        this.ltr_fname.Text = cCustomer.FirstName;
        this.ltr_lname.Text = cCustomer.LastName;

        this.ltr_dname.Text = cCustomer.DisplayName;
        this.ltr_ordertotal.Text = cCustomer.TotalOrders.ToString();
        this.ltr_orderval.Text = defaultCurrency.ISOCurrencySymbol + EkFunctions.FormatCurrency(cCustomer.TotalOrderValue, defaultCurrency.CultureCode);
        this.ltr_pervalue.Text = defaultCurrency.ISOCurrencySymbol + EkFunctions.FormatCurrency(cCustomer.AverageOrderValue, defaultCurrency.CultureCode);
        // customer
        // orders
        Criteria<OrderProperty> orderCriteria = new Criteria<OrderProperty>();
        orderCriteria.AddFilter(OrderProperty.CustomerId, CriteriaFilterOperator.EqualTo, m_iID);
        orderList = orderApi.GetList(orderCriteria);
        if (orderList.Count == 0)
        {
            ltr_orders.Text = this.GetMessage("lbl no orders");
        }
        dg_orders.DataSource = orderList;
        dg_orders.DataBind();
        // orders
        // addresses
        aAddreses = AddressManager.GetList(m_iID);
        if (aAddreses.Count == 0)
        {
            ltr_address.Text = this.GetMessage("lbl no addresses");
        }
        dg_address.DataSource = aAddreses;
        dg_address.DataBind();
        // addresses
        // baskets
        if (this.m_iID > 0)
        {
            basketList = basketApi.GetList(this.m_iID);
            if (basketList.Count == 0)
            {
                ltr_baskets.Text = this.GetMessage("lbl no baskets");
            }
            dg_baskets.DataSource = basketList;
            dg_baskets.DataBind();
        }
    }
Esempio n. 2
0
    protected void Display_ByDates()
    {
        DateTime startDate = Convert.ToDateTime(Request.QueryString["startdate"]);
        DateTime endDate = Convert.ToDateTime(Request.QueryString["enddate"]);
        List<OrderData> orderList = new List<OrderData>();
        OrderApi orderApi = new OrderApi();

        orderList = orderApi.GetList(startDate, endDate, new PagingInfo());

        dg_orders.DataSource = orderList;
        dg_orders.DataBind();
    }
Esempio n. 3
0
    protected void Display_MostRecent()
    {
        List<OrderData> orderList = new List<OrderData>();
        OrderApi orderApi = new OrderApi();

        orderList = orderApi.GetList(new Criteria<OrderProperty>());

        dg_orders.DataSource = orderList;
        dg_orders.DataBind();
    }