private void btn_sure_Click(object sender, EventArgs e) { DateTime startDate = dateEdit_Start.DateTime.Date; DateTime endDate = dateEdit_End.DateTime.Date; TB_DailyPlanCatalog currentCatalog = cmb_PlanItem.SelectedItem as TB_DailyPlanCatalog; //完成日期比例 dataBuilder_Precent.ClearDataSeries(); dataBuilder_Precent.AddDataFromTable(statistician.StatisticDailySignPrecent(startDate, endDate, currentCatalog), 0, 1); chartHelper_Precent.ReplaceSeries(dataBuilder_Precent.DataSeries); //完成状态柱状图 dataBuilder_State.ClearDataSeries(); dataBuilder_State.AddDataFromDictonary(statistician.StatisticDailySignState(startDate, endDate, currentCatalog)); chartHelper_State.ReplaceSeries(dataBuilder_State.DataSeries); //完成日历 schedulerStorage1.Appointments.Clear(); foreach (var item in controller.QueryEntryByDateAndCatalog(startDate, endDate, currentCatalog.ID)) { Appointment appoint = schedulerStorage1.Appointments.CreateAppointment(DevExpress.XtraScheduler.AppointmentType.Normal); appoint.AllDay = true; appoint.Subject = item.Completion; appoint.Start = DateTime.Parse(item.Date); appoint.End = appoint.End; schedulerStorage1.Appointments.Add(appoint); } schedulerControl1.Start = dateEdit_Start.DateTime; if (adapter != null) { adapter.NotifyClearTable(); adapter.NotifyDestoryTable(); } //完成列表 adapter.Initial(controller.QueryEntryByDateAndCatalog(startDate, endDate, currentCatalog.ID), builder); adapter.NotifyfreshDataTable(); gridHelper_Record.GridControl.DataSource = adapter.ResultTable; gridHelper_Record.SetAllColumnEditable(false); gridHelper_Record.SetAllColumnVisible(false); gridHelper_Record.setColunmsVisual(true, builder.Completion, builder.Other, builder.Date); }
private void btn_ReadPlanState_Click(object sender, EventArgs e) { dataBuilder_State.ClearDataSeries(); dataBuilder_State.AddDataFromDictonary(statistician.StatisticianReadPlanState(dateE_State_Start.DateTime, dateE_State_End.DateTime)); chartHelper_State.ReplaceSeries(dataBuilder_State.DataSeries); }