Exemplo n.º 1
0
    /// <summary>
    /// Page Load Event
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Request.Params["filter"] != null)
            {
                Mode = Request.Params["filter"];
            }

            //Bind Supplier
            SupplierAdmin supplier = new SupplierAdmin();
            ddlSupplier.DataSource = supplier.GetAll();
            ddlSupplier.DataTextField = "name";
            ddlSupplier.DataValueField = "supplierid";
            ddlSupplier.DataBind();
            ListItem li1 = new ListItem("None", "0");
            ddlSupplier.Items.Insert(0, li1);

            //Get Filetered Orders in DataSet
            OrderAdmin _OrderAdmin = new OrderAdmin();
            DataView dv = new DataView();

            dsOrders = _OrderAdmin.ReportList(Mode, Year,"");
            dsOrdersLineItems = _OrderAdmin.GetAllOrderLineItems().ToDataSet(false);
            dv = new DataView(dsOrders.Tables[0]);

            if (Request.Params["filter"] != null)
            {
                this.objReportViewer.LocalReport.ReportPath = "Admin/Secure/Reports/SupplierReport.rdlc";
            }

            if (dv.ToTable().Rows.Count == 0)
            {
                lblErrorMsg.Text = "No records found";
                objReportViewer.Visible = false;
                return;
            }

            objReportViewer.LocalReport.DataSources.Clear();
            ReportParameter param1 = new ReportParameter("CurrentLanguage", System.Globalization.CultureInfo.CurrentCulture.Name);
            objReportViewer.LocalReport.SetParameters(new ReportParameter[] { param1 });
            this.objReportViewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
            objReportViewer.LocalReport.DataSources.Add(new ReportDataSource("ZNodeOrderDataSet_ZNodeOrder", dv));
            objReportViewer.LocalReport.DataSources.Add(new ReportDataSource("ZNodeOrderLineItems_ZNodeOrderLineItem", dsOrdersLineItems.Tables[0]));
            objReportViewer.LocalReport.Refresh();
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// Bind data to grid
    /// </summary>
    private void BindGridData()
    {
        ZNode.Libraries.Admin.SupplierAdmin supplierAdmin = new SupplierAdmin();
        TList<ZNode.Libraries.DataAccess.Entities.Supplier> supplier = supplierAdmin.GetAll();

        if (supplier != null)
        {
            supplier.Sort("Name Asc");
        }

        uxGrid.DataSource = supplier;
        uxGrid.DataBind();
    }