protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.UsageChartDataBinding(); LoadCompany(); } List <UsageItem> us = new List <UsageItem>(); DataView dv = (DataView)SqlDataSource4.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } }
protected void btnApply_Click(object sender, EventArgs e) { if (cboCompany.SelectedItem.Value != string.Empty && cboCycle.SelectedItem.Value != string.Empty && !string.IsNullOrEmpty(txtAcctNum.Text) && !string.IsNullOrWhiteSpace(txtAcctNum.Text)) { //use viewUsageSummarybyAccount view List<UsageItem> us = new List<UsageItem>(); DataView dv = (DataView)SqlDataSource3.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } else { if (cboCompany.SelectedItem.Value != string.Empty && cboCycle.SelectedItem.Value != string.Empty) { //use viewUsageSummaryByCycle view List<UsageItem> us = new List<UsageItem>(); DataView dv = (DataView)SqlDataSource2.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } else { if (cboCompany.SelectedItem.Value != string.Empty) { List<UsageItem> us = new List<UsageItem>(); DataView dv = (DataView)SqlDataSource1.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } else { //use all data List<UsageItem> us = new List<UsageItem>(); DataView dv = (DataView)SqlDataSource4.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } } } }
protected void btnApply_Click(object sender, EventArgs e) { if (cboCompany.SelectedItem.Value != string.Empty && cboCycle.SelectedItem.Value != string.Empty && !string.IsNullOrEmpty(txtAcctNum.Text) && !string.IsNullOrWhiteSpace(txtAcctNum.Text)) { //use viewUsageSummarybyAccount view List <UsageItem> us = new List <UsageItem>(); DataView dv = (DataView)SqlDataSource3.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } else { if (cboCompany.SelectedItem.Value != string.Empty && cboCycle.SelectedItem.Value != string.Empty) { //use viewUsageSummaryByCycle view List <UsageItem> us = new List <UsageItem>(); DataView dv = (DataView)SqlDataSource2.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } else { if (cboCompany.SelectedItem.Value != string.Empty) { List <UsageItem> us = new List <UsageItem>(); DataView dv = (DataView)SqlDataSource1.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } else { //use all data List <UsageItem> us = new List <UsageItem>(); DataView dv = (DataView)SqlDataSource4.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.UsageChartDataBinding(); LoadCompany(); } List<UsageItem> us = new List<UsageItem>(); DataView dv = (DataView)SqlDataSource4.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } }