Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        private void date_Update_EditValueChanged(object sender, EventArgs e)
        {
            if (adapter != null)
            {
                adapter.NotifyClearTable();
                adapter.NotifyDestoryTable();
            }

            adapter.Initial(controller.QueryEntryByDate(this.date_Update.DateTime.Date), builder);
            if (adapter.ItemCount == 0)
            {
                MessageBoxHelper.ShowDialog("提示", "当前日期没有打卡记录");
                return;
            }

            adapter.NotifyfreshDataTable();
            this.gridControl_Sign.DataSource = adapter.ResultTable;

            gridHelper.SetAllColumnVisible(false);
            gridHelper.SetColunmOption(builder.CatalogID, false, true);
            gridHelper.HighLightRowByCommand(new DailySignFinishStateHighlightCommand());
        }