platform/wms/Charts.aspx - 副本.cs

108 lines
2.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DeiNiu.Utils;
using DeiNiu.wms.Logical;
using DevExpress.XtraCharts;
using System.Data;
public partial class wms_Charts : System.Web.UI.Page
{
DataSet ds;
lCharts lchart = new lCharts();
protected void Page_Load(object sender, EventArgs e)
{
loadData();
}
void loadData()
{
ds = lchart.getDailyKanBanData();
setTasks();
setLocs();
setUserTasks();
}
void setLocs()
{
DataTable dt = ds.Tables[2];
Series taskSeries = this.webChartLocs.SeriesSerializable[0];
taskSeries.Points.Clear();
foreach (DataRow dr in dt.Rows)
{
taskSeries.Points.Add(new SeriesPoint(dr["volType"].ToString(), Convert.ToInt32(dr["totalCnt"].ToString())));
}
Series finishedSeries = webChartLocs.SeriesSerializable[1];
finishedSeries.Points.Clear();
foreach (DataRow dr in dt.Rows)
{
finishedSeries.Points.Add(new SeriesPoint(dr["volType"].ToString(), Convert.ToInt32(dr["usedCnt"].ToString())));
}
}
void setUserTasks()
{
DataTable dt = ds.Tables[1];
Series taskSeries = this.webChartEmpTasks.SeriesSerializable[0];
taskSeries.Points.Clear();
foreach (DataRow dr in dt.Rows)
{
taskSeries.Points.Add(new SeriesPoint(dr["emName"].ToString(), Convert.ToInt32(dr["taskCnt"].ToString())));
}
}
void setTasks()
{
DataTable dt = ds.Tables[0];
Series taskSeries = this.WebChartTasks.SeriesSerializable[0];
taskSeries.Points.Clear();
foreach (DataRow dr in dt.Rows)
{
taskSeries.Points.Add(new SeriesPoint(dr["typeName"].ToString(), Convert.ToInt32(dr["taskCnt"].ToString())));
}
Series finishedSeries = WebChartTasks.SeriesSerializable[1];
finishedSeries.Points.Clear();
foreach (DataRow dr in dt.Rows)
{
finishedSeries.Points.Add(new SeriesPoint(dr["typeName"].ToString(), Convert.ToInt32(dr["finishedCnt"].ToString())));
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
// loadData();// Page_Load(sender, e);
}
}