예제 #1
0
파일: order.aspx.cs 프로젝트: jaytem/minGit
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsCommerceAdmin)
            return;

        long orderId = (Request.QueryString["id"] != null ? Convert.ToInt64(Request.QueryString["id"]) : 0);
        OrderApi orderAPI = new OrderApi();
        OrderData order = orderAPI.GetItem(orderId);
        string type = (Request.QueryString["type"] != null ? Request.QueryString["type"] : "pdf");
        Ektron.Cms.Common.Export.ExportManager exportManager = new Ektron.Cms.Common.Export.ExportManager();

        Response.Clear();

        switch (type)
        {

            case "csv":

                exportManager.SetProvider("CSVExportProvider");
                Response.AddHeader("Content-Disposition", "attachment;filename=order.csv");
                Response.ContentType = "text/csv";

                break;

            case "xls":

                exportManager.SetProvider("XLSExportProvider");
                Response.AddHeader("Content-Disposition", "attachment;filename=order.xls");
                Response.ContentType = "application/ms-excel";

                break;

            default:

                exportManager.SetProvider("PDFExportProvider");
                Response.AddHeader("Content-Disposition", "attachment;filename=order.pdf");
                Response.ContentType = "application/pdf";

                break;

        }

        Response.BinaryWrite(exportManager.ExportToFile(order));
        Response.End();
    }
예제 #2
0
    protected void Display_ViewOrder()
    {
        OrderApi orderApi = new OrderApi();
        order = orderApi.GetItem(this.m_iID);

        this.ltr_id.Text = order.Id.ToString();
        this.ltr_customer.Text = Util_ShowCustomer(order.Customer);
        this.ltr_created.Text = Util_ShowDate(order.DateCreated);
        this.ltr_completed.Text = Util_ShowDate(order.DateCompleted);
        this.ltr_required.Text = Util_ShowDate(order.DateRequired);
        this.ltr_orderstatus.Text = System.Enum.GetName(typeof(EkEnumeration.OrderStatus), order.Status);
        this.ltr_ordertotal.Text = FormatCurrency(order.OrderTotal, "");
        this.ltr_pipelinestage.Text = order.StageName;

        this.dg_orderparts.DataSource = order.Parts;
        this.dg_orderparts.DataBind();
        this.dg_orderlines.DataSource = order.Parts[0].Lines;
        this.dg_orderlines.DataBind();
    }