/// <summary> /// 缴费信息数据绑定 /// </summary> public override void DataBind() { Maticsoft.BLL.chart.chart bll = new Maticsoft.BLL.chart.chart(); // string sqlw = string.Format(" RegisterDate>'{0}' And RegisterDate<'{1}' And IsCheckOver='1'"); string sqlw = " 1=1 "; if (txtStartDate.Text != "") { sqlw += string.Format(" And PaymentDate>='{0}' ", Convert.ToDateTime(txtStartDate.Text)); } if (txtEndDate.Text != "") { sqlw += string.Format(" And PaymentDate<'{0}' ", Convert.ToDateTime(txtEndDate.Text).AddDays(1)); } DataSet ds = bll.GetListByPage_DepartmentCharge(sqlw, "", (Pager.CurrentPageIndex - 1) * Pager.PageSize, (Pager.CurrentPageIndex) * Pager.PageSize); Pager.RecordCount = bll.GetRecordCount_DepartmentCharge(sqlw); ReportRepeater.DataSource = ds.Tables[0]; DataSet dssum = bll.GetSum_DepartmentCharge(sqlw); lblchecknum.Text = dssum.Tables[0].Rows[0][0].ToString(); lblActualCharge.Text = dssum.Tables[0].Rows[0][1].ToString(); base.DataBind(); }
public override void DataBind() { base.DataBind(); Title m_Title = Chart1.Titles[0]; m_Title.Font = new Font("宋体", 12f); m_Title.Font = new Font("宋体", 12f, System.Drawing.FontStyle.Bold); m_Title.Text = "历年" + drpTrades.SelectedItem.Text + "从业人员体检人数分布"; ChartArea chartaera = Chart1.ChartAreas["ChartArea1"]; chartaera.AxisX.LabelStyle.Font = new Font("宋体", 9.75f); chartaera.AxisY.LabelStyle.Font = new Font("宋体", 9.75f); Series Series1 = Chart1.Series[0]; Series1.Points.Clear(); //DateTime startDateTime = new DateTime(Convert.ToInt32(drpYears.SelectedValue) - 1, 1, 1), endDateTime = new DateTime(Convert.ToInt32(drpYears.SelectedValue) - 1, 12, 31); //DateTime DateTime = new DateTime(Convert.ToInt32(drpYears.SelectedValue) - 1, 1, 1); int yearBegin = DateTime.Now.AddYears(-10).Year; int yearEnd = DateTime.Now.Year; int pointValue; string strSql = string.Format(" LEFT(RegisterNo,4)>='{0}' And LEFT(RegisterNo,4)<='{1}' And B.TradeCode='{2}' ", yearBegin, yearEnd, drpTrades.SelectedValue); DataTable dt = new Maticsoft.BLL.chart.chart().GetList_TradeYear(strSql).Tables[0]; for (int i = yearBegin; i <= yearEnd; i++) { // //DateTime = DateTime.AddYears(1); DataRow[] rows2 = dt.Select("nian='" + i.ToString() + "'"); if (rows2.Length > 0) { pointValue = Convert.ToInt32(rows2[0]["pointValue"].ToString()); } else { pointValue = 0; } Series1.Points.AddXY(i.ToString(), pointValue); } }
private void ClientInitial() { Title m_Title = Chart1.Titles[0]; m_Title.Font = new Font("宋体", 12f); m_Title.Font = new Font("宋体", 12f, System.Drawing.FontStyle.Bold); m_Title.Text = "体检人数同比分析"; ChartArea chartaera = Chart1.ChartAreas["OutputChartArea"]; chartaera.AxisX.LabelStyle.Font = new Font("宋体", 9.75f); chartaera.AxisY.LabelStyle.Font = new Font("宋体", 9.75f); Series Series1 = Chart1.Series[0]; Series Series2 = Chart1.Series[1]; Series1.Points.Clear(); Series2.Points.Clear(); Series1.IsValueShownAsLabel = true; Series2.IsValueShownAsLabel = true; Series1.LegendText = Convert.ToString(Convert.ToInt32(drpYears.SelectedValue) - 1); Series2.LegendText = drpYears.SelectedValue; string strSql = ""; strSql = string.Format(" LEFT(RegisterNo,4)>='{0}' And LEFT(RegisterNo,4)<='{1}' ", Convert.ToInt32(drpYears.SelectedValue) - 1, drpYears.SelectedValue); DataTable dt = new Maticsoft.BLL.chart.chart().GetList_PersonNumber(strSql).Tables[0]; DateTime startDateTime = new DateTime(Convert.ToInt32(drpYears.SelectedValue) - 1, 1, 1), endDateTime = new DateTime(Convert.ToInt32(drpYears.SelectedValue) - 1, 12, 31); DateTime DateTime = new DateTime(Convert.ToInt32(drpYears.SelectedValue) - 1, 1, 1); int pointValue; while (DateTime <= endDateTime) { DataRow[] rows1 = dt.Select("dateM='" + DateTime.ToString("yyyyMM") + "'"); if (rows1.Length > 0) { pointValue = Convert.ToInt32(rows1[0]["pointValue"].ToString()); } else { pointValue = 0; } Series1.Points.AddXY(DateTime, pointValue); DataRow[] rows2 = dt.Select("dateM='" + DateTime.AddYears(1).ToString("yyyyMM") + "'"); if (rows2.Length > 0) { pointValue = Convert.ToInt32(rows2[0]["pointValue"].ToString()); } else { pointValue = 0; } Series2.Points.AddXY(DateTime, pointValue); DateTime = DateTime.AddMonths(1); } }