public Bitmap Pie_InfoStat(string getGrade,string getClass,GroupControl gControl)
		{
			using ( StudentAttendCalcDataAccess stuAttCalcDataAccess = new StudentAttendCalcDataAccess() )
			{
				try
				{
					stuAttCalcDataAccess.DoAttendCalcForClass(getGrade,getClass,BegDate.ToString("yyyy-MM-dd"),EndDate.ToString("yyyy-MM-dd"),"健康");
					double healthPer = (double)stuAttCalcDataAccess.StateAmount/((double)stuAttCalcDataAccess.StuAmount*SetAttendDays())*100;
					stuAttCalcDataAccess.DoAttendCalcForClass(getGrade,getClass,BegDate.ToString("yyyy-MM-dd"),EndDate.ToString("yyyy-MM-dd"),"服药");
					double illPer = (double)stuAttCalcDataAccess.StateAmount/((double)stuAttCalcDataAccess.StuAmount*SetAttendDays())*100;
					stuAttCalcDataAccess.DoAttendCalcForClass(getGrade,getClass,BegDate.ToString("yyyy-MM-dd"),EndDate.ToString("yyyy-MM-dd"),"观察");
					double watchPer = (double)stuAttCalcDataAccess.StateAmount/((double)stuAttCalcDataAccess.StuAmount*SetAttendDays())*100;
//					stuAttCalcDataAccess.DoAttendCalcForClass(getGrade,getClass,BegDate.ToString("yyyy-MM-dd"),EndDate.ToString("yyyy-MM-dd"),"缺席");
//					double absPer = (double)stuAttCalcDataAccess.StateAmount/((double)stuAttCalcDataAccess.StuAmount*SetAttendDays())*100;
					double absPer = 100-healthPer-illPer-watchPer;

//					Graphics gra = gControl.CreateGraphics();
//					GraphPane myPane = new GraphPane( new Rectangle( 0, 0, gControl.Width, gControl.Height ),
//						"11", "11", "11" );
					zedGraph_StuPiePrint = new ZedGraphControl();
					gControl.Controls.Clear();
					gControl.Controls.Add(zedGraph_StuPiePrint);
					zedGraph_StuPiePrint.Dock = DockStyle.Fill;
					
					GraphPane myPane = zedGraph_StuPiePrint.GraphPane;

					if ( getGrade.Equals("") )
						myPane.Title = new GardenInfoDataAccess().GetGardenInfo().Tables[0].Rows[0][1].ToString()
							+ "全年级晨检信息统计图\n"+"统计日期: " + BegDate.ToString("yyyy.MM.dd") + " 至 "
							+ EndDate.ToString("yyyy.MM.dd");
					else if ( getClass.Equals("") )
						myPane.Title = new GardenInfoDataAccess().GetGardenInfo().Tables[0].Rows[0][1].ToString()
							+ new StuInfoDataAccess().GetGradeList("",getGrade).Tables[0].Rows[0][1].ToString()
							+ "晨检信息统计图\n"+"统计日期: " + BegDate.ToString("yyyy.MM.dd") + " 至 "
							+ EndDate.ToString("yyyy.MM.dd");
					else
						myPane.Title = new GardenInfoDataAccess().GetGardenInfo().Tables[0].Rows[0][1].ToString()
							+ new RealtimeInfoDataAccess().setClassList("",getClass,getGrade).Tables[0].Rows[0][1].ToString()
							+ "晨检信息统计图\n"+"统计日期: " + BegDate.ToString("yyyy.MM.dd") + " 至 "
							+ EndDate.ToString("yyyy.MM.dd");

					double[] statusVal = { healthPer, watchPer, absPer, illPer };
					string[] statusLabel = { "健康", "观察", "缺席", "服药"  };

					myPane.PaneFill = new Fill( Color.Cornsilk );
					myPane.AxisFill = new Fill( Color.Cornsilk );
					myPane.Legend.Position = LegendPos.Right ;
					myPane.Legend.FontSpec.Size = 14;

					PieItem [] slices = new PieItem[statusVal.Length] ;
					slices = myPane.AddPieSlices ( statusVal, statusLabel ) ;
					
					((PieItem)slices[0]).LabelType = PieLabelType.Percent ;
					((PieItem)slices[0]).LabelDetail.FontSpec.Size = 14;
					((PieItem)slices[1]).LabelType = PieLabelType.Percent ;
					((PieItem)slices[1]).LabelDetail.FontSpec.Size = 14;
					((PieItem)slices[2]).LabelType = PieLabelType.Percent ;
					((PieItem)slices[2]).LabelDetail.FontSpec.Size = 14;
					((PieItem)slices[3]).LabelType = PieLabelType.Percent ;
					((PieItem)slices[3]).LabelDetail.FontSpec.Size = 14;
					((PieItem)slices[1]).Displacement = .2 ;
					((PieItem)slices[2]).Displacement = .2 ;

					BoxItem box = new BoxItem( new RectangleF( 0F, 0F, 1F, 1F ),
						Color.Empty, Color.PeachPuff );
					box.Location.CoordinateFrame = CoordType.AxisFraction;
					box.Border.IsVisible = false;
					box.Location.AlignH = AlignH.Left;
					box.Location.AlignV = AlignV.Top;
					box.ZOrder = ZOrder.E_BehindAxis;

					myPane.GraphItemList.Add( box );
//					myPane.AxisChange(gra);
//					myPane.Draw(gra);

//					myPane.ReSize(gra,new RectangleF(150, 300, 800,600));

					zedGraph_StuPiePrint.IsShowContextMenu = false;
					zedGraph_StuPiePrint.IsEnableZoom = false;
					zedGraph_StuPiePrint.AxisChange();

					return myPane.Image;
				}
				catch(Exception e)
				{
					Util.WriteLog(e.Message,Util.EXCEPTION_LOG_TITLE);
					return null;
				}
			}
		}
Beispiel #2
0
		public void SetStuAttendCalcForSolo(string getName,string getNumber,string getBegTime,
			string getEndTime,string getState)
		{
			BegDate = Convert.ToDateTime(getBegTime);
			EndDate = Convert.ToDateTime(getEndTime);
			using (StudentAttendCalcDataAccess stuAttendCalcDataAccess = new StudentAttendCalcDataAccess())
			{
				stuAttendCalcDataAccess.DoAttendCalcForSolo(getName,getNumber,getBegTime,getEndTime,getState);
				StateAmountInDays = stuAttendCalcDataAccess.StateAmount;
				AllStateAmountInDays = stuAttendCalcDataAccess.AllStateAmount;
				StuAttendAmountInDays = stuAttendCalcDataAccess.StuAmount * SetAttendDays();
			}
		}
Beispiel #3
0
		public void SetStuBackCalc(string getGrade,string getClass,string getName,string getNumber,string getBegTime,
			string getEndTime)
		{
			BegDate = Convert.ToDateTime(getBegTime);
			EndDate = Convert.ToDateTime(getEndTime);
			using ( StudentAttendCalcDataAccess stuAttendCalcDataAccess = new StudentAttendCalcDataAccess() )
			{
				stuAttendCalcDataAccess.DoBackCalc(getGrade,getClass,getName,getNumber,getBegTime,getEndTime);
				HasGoneNumber = stuAttendCalcDataAccess.HasGone;
				HasnotGoneNumber = stuAttendCalcDataAccess.HasnotGone;
				AllStateAmountInDays = stuAttendCalcDataAccess.AllStateAmount;
			}
		}
Beispiel #4
0
		public DataSet GetStuStatusList()
		{
			try
			{
				using (StudentAttendCalcDataAccess stuAttendCalcDataAccess = new StudentAttendCalcDataAccess())
				{
					return stuAttendCalcDataAccess.DoGetStatusList();
				}
			}
			catch(Exception e)
			{
				Util.WriteLog(e.Message,Util.EXCEPTION_LOG_TITLE);
				return null;
			}
		}