コード例 #1
0
ファイル: PLinePlanForm.cs プロジェクト: guocc911/CBIReport
        /// <summary>
        /// 加载计划列表
        /// </summary>
        private void LoadPlanGrid()
        {
            try
            {
                this.dayView1.Appointments.Clear();

                this.dayView1.RefreshAppointments();
                DateTime weekstart = this.dateTimePicker1.Value;
                dayView1.Date = weekstart;

                ProductionPlanDal dal = new ProductionPlanDal();

                int    lineID = this.cbPLine.SelectedIndex + 1;
                string planID = this.dateTimePicker1.Value.ToString("yyyyMMdd");
                planID = string.Format("{0}_{1}", planID, lineID);

                DataTable table = dal.GetProductionPalnByPlanID(planID);


                if (table == null || table.Rows.Count <= 0)
                {
                    this.dayView1.RefreshAppointments();

                    this.dayView1.Invalidate();
                    return;
                }
                else
                {
                    this.dayView1.Appointments = GetPlanPoints(table);

                    this.dayView1.RefreshAppointments();

                    this.dayView1.Invalidate();
                }
            }
            catch (Exception ex)
            {
                CLog.WriteErrLogInTrace(ex.Message.ToString());
            }
        }