Ejemplo n.º 1
0
        private void okButton_Click(object sender, EventArgs e)
        {
            if (!contentTextBox.Text.Equals(""))
            {
                string planDate      = dateTimePicker.Text;
                string startPlanDate = _planClassControl.planClassControlInitParameter.startTime;
                string endPlanDate   = _planClassControl.planClassControlInitParameter.endTime;

                DateTimeFormatInfo format = new System.Globalization.DateTimeFormatInfo();
                format.ShortDatePattern = DATE_PATTERN;
                DateTime planDateTime      = Convert.ToDateTime(planDate, format);
                DateTime startPlanDateTime = Convert.ToDateTime(startPlanDate, format);
                DateTime endPlanDateTime   = Convert.ToDateTime(endPlanDate, format);

                int compare1 = DateTime.Compare(planDateTime, endPlanDateTime);
                int compare2 = DateTime.Compare(planDateTime, startPlanDateTime);
                if (compare1 <= 0 && compare2 >= 0)
                {
                    Label planL = new Label();
                    planL.Text = dateTimePicker.Text + ":" + contentTextBox.Text;
                    int lengthOfLine = PlanClassControl.convertDateToLengthOfLine(planDate, _planClassControl.planClassControlInitParameter.endTime);
                    planL.Location  = new Point(_planClassControl.pPictureBox.Width / 2 - CENTER_OFFSET, lengthOfLine + POINT_HEIGHT_BASE);
                    planL.ForeColor = NewPlanInitParameterForm.createRandomColor();
                    _planClassControl.pPictureBox.Controls.Add(planL);
                }
                else
                {
                    DialogResult dr1 = MessageBox.Show(loadGlobalChineseCharacters.GlobalChineseCharactersDict["exception2"], loadGlobalChineseCharacters.GlobalChineseCharactersDict["exception"]);
                }
            }
        }
Ejemplo n.º 2
0
 private void initControl(PlanClassControlInitParameter planClassControlInitParameter)
 {
     planPanel.AutoScroll    = true;
     planPictureBox.SizeMode = PictureBoxSizeMode.AutoSize;
     lengthOfLine            = convertDateToLengthOfLine(planClassControlInitParameter.startTime, planClassControlInitParameter.endTime);
     planPictureBox.Height   = PICTURE_BOX_HEIGHT_BASE + lengthOfLine;
     color = planClassControlInitParameter.color;
     drawTimeMainAxis();
     titleLabel.Text      = planClassControlInitParameter.title;
     titleLabel.Location  = new Point(this.Width / 2 - titleLabel.Width / 2, TITLE_LABEL_TOP);
     titleLabel.ForeColor = NewPlanInitParameterForm.createRandomColor();
 }
Ejemplo n.º 3
0
        private void addPlanButton_Click(object sender, EventArgs e)
        {
            NewPlanInitParameterForm newPlanInitParameterForm = new NewPlanInitParameterForm(this);

            newPlanInitParameterForm.Show();
        }