protected void BindOrderStatus() { OrderAdmin orderAdmin = new OrderAdmin(); ddlOrderStateList.DataSource = orderAdmin.GetAllOrderStates(); ddlOrderStateList.DataTextField = "OrderStateName"; ddlOrderStateList.DataValueField = "OrderStateID"; ddlOrderStateList.DataBind(); }
/// <summary> /// Page Load Event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (Request.Params["filter"] != null) { Mode = Request.Params["filter"]; } if (!Page.IsPostBack) { // Load Order State Item OrderAdmin _OrderAdminAccess = new OrderAdmin(); ddlOrderStatus.DataSource = _OrderAdminAccess.GetAllOrderStates(); ddlOrderStatus.DataTextField = "orderstatename"; ddlOrderStatus.DataValueField = "Orderstateid"; ddlOrderStatus.DataBind(); ListItem item1 = new ListItem("ALL", "0"); ddlOrderStatus.Items.Insert(0, item1); ddlOrderStatus.SelectedIndex = 0; // Load Profile Types ProfileAdmin profileAdmin = new ProfileAdmin(); ddlProfilename.DataSource = profileAdmin.GetAll(); ddlProfilename.DataTextField = "Name"; ddlProfilename.DataValueField = "ProfileID"; ddlProfilename.DataBind(); ListItem item2 = new ListItem("ALL", "0"); ddlProfilename.Items.Insert(0, item2); ddlProfilename.SelectedIndex = 0; // Get Filetered Orders in DataSet OrderAdmin _OrderAdmin = new OrderAdmin(); dsOrders = _OrderAdmin.ReportList(Mode, Year, ""); dsOrdersLineItems = _OrderAdmin.GetAllOrderLineItems().ToDataSet(false); DataView dv = new DataView(dsOrders.Tables[0]); if (Request.Params["filter"] != null) { if (Mode.Equals("12")) { this.objReportViewer.LocalReport.ReportPath = "Admin/Secure/Reports/Orders.rdlc"; pnlOrderStatus.Visible = true; lblOrderStatus.Visible = true; lblOrderStatus.Text = "Order Status"; btnOrderFilter.Text = "Get Orders"; } if (Mode.Equals("21")) { this.objReportViewer.LocalReport.ReportPath = "Admin/Secure/Reports/Accounts.rdlc"; pnlprofile.Visible = true; lblProfileName.Visible = true; lblProfileName.Text = "Profiles"; btnOrderFilter.Text = "Get Details"; } } if (dv.ToTable().Rows.Count == 0) { lblErrorMsg.Text = "No records found"; objReportViewer.Visible = false; pnlCustom.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); if (Mode.Equals("12")) objReportViewer.LocalReport.DataSources.Add(new ReportDataSource("ZNodeOrderDataSet_ZNodeOrder", dv)); else if(Mode.Equals("21")) objReportViewer.LocalReport.DataSources.Add(new ReportDataSource("ZNodeAccountDataSet_ZNodeAccount", dv)); objReportViewer.LocalReport.Refresh(); } }