// Constructor.
        public DataAddForm(Label date, CalendarMain calendar, bool mode)
        {
            InitializeComponent();
            this.date     = date;
            this.calendar = calendar;
            modifyMode    = mode;

            if (mode)
            {
                this.Text = "Modify schedule";
            }
            else
            {
                this.Text = "Add schedule";
            }

            dateStrSetting();

            startDateTemp = new DateTime();
            endDateTemp   = new DateTime();

            startDateTemp = startDateTemp.AddYears(int.Parse(dateStr[0]) - 1).AddMonths(int.Parse(dateStr[1]) - 1).AddDays(int.Parse(dateStr[2]) - 1);
            endDateTemp   = endDateTemp.AddYears(int.Parse(dateStr[0]) - 1).AddMonths(int.Parse(dateStr[1]) - 1).AddDays(int.Parse(dateStr[2]) + 3);

            dateTimePicker_end.Value   = endDateTemp;
            groupBox_curdatecheck.Text = dateStr[0] + "." + dateStr[1] + "." + dateStr[2];

            //TimeSpan temp = DateTime.Parse(endDateTemp.ToString("yyyy-MM-dd")) - DateTime.Parse(startDateTemp.ToString("yyyy-MM-dd"));
            //int day_temp = temp.Days;
        }
Esempio n. 2
0
 // Constructor.
 public TodayDataAddForm(CalendarMain calendar, SQLiteConnection conn, bool mode)
 {
     InitializeComponent();
     this.calendar = calendar;
     tempConnect   = conn;
     isAddMode     = mode;
 }
        // Constructor.
        public DataAddForm(Label date, CalendarMain calendar, SQLiteConnection connect, bool isModifyMode)
        {
            InitializeComponent();
            this.date     = date;
            this.calendar = calendar;
            tempConnect   = connect;

            if (!isModifyMode)
            {
                this.Text = "Add schedule";
            }
            else
            {
                this.Text = "Modify schedule";
            }

            string[] tempString = date.Text.Split('.');
            originalYMD = dateYMD = new decimal[3] {
                decimal.Parse(tempString[0]), decimal.Parse(tempString[1]), decimal.Parse(tempString[2])
            };

            startDateTemp = new DateTime((int)dateYMD[0], (int)dateYMD[1], (int)dateYMD[2]);
            dateTimePicker_start.Value = new DateTime(startDateTemp.Ticks);
            dateTimePicker_end.Value   = new DateTime(startDateTemp.Ticks).AddDays(2);
        }
 // Constructor.
 public DataView(CalendarMain calendar, SQLiteConnection connect)
 {
     InitializeComponent();
     originalHM    = new decimal[2];
     this.calendar = calendar;
     tempConnect   = connect;
     RefreshData();
 }
        // Constructor.
        public DataView(SQLiteConnection connect, CalendarMain cmain)
        {
            InitializeComponent();

            this.connect = connect;
            this.cmain   = cmain;
            refreshData();
        }
        public AlarmStatusChange(CalendarMain main, ToolStripMenuItem alaItem, Button alaButton, ThreadManager tmanager, int mode)
        {
            if ((alaItem.Checked == false && mode == STRIP_CLICK) || mode == BC_TRUE)
            {
                alaItem.Checked = true;
                alaItem.Text    = "Alarm : ON";
                tmanager.AlarmOnOff_check(true);
                main.SetAlarmOnCheck(true);
                alaButton.Text = "ON";
            }

            else if ((alaItem.Checked == true && mode == STRIP_CLICK) || mode == BC_FALSE)
            {
                alaItem.Checked = false;
                alaItem.Text    = "Alarm : OFF";
                tmanager.AlarmOnOff_check(false);
                main.SetAlarmOnCheck(false);
                alaButton.Text = "OFF";
            }
        }
Esempio n. 7
0
        // Constructor.
        public TodayDataAddForm(CalendarMain calendar)
        {
            InitializeComponent();

            this.calendar = calendar;
        }