Ejemplo n.º 1
0
        // ListBoxに予定を追加する
        private void PlansListAdd()
        {
            string str;

            plans = database.displayPlans(year, month, day);
            for (int k = 0; k < plans.GetLength(0); k++)
            {
                str = "";
                if (!(plans[k][0] == ""))
                {
                    str += plans[k][0] + " ~ " + plans[k][1] + " ";
                }
                str += plans[k][2];
                listBox1.Items.Add(str);
            }
        }
Ejemplo n.º 2
0
        // カレンダーに予定を挿入する
        public void SetPlans()
        {
            int  count        = 0;
            int  dayNum       = 1;
            int  dayMaxNum    = dayC.GetDayNum(Year, Month);
            bool dayCountFlag = false;
            int  weekNum      = dayC.GetWeekNum(Year, Month, 1);

            for (int i = 1; i < tableLayoutPanel1.RowCount; i += 2)
            {
                for (int j = 0; j < tableLayoutPanel1.ColumnCount; j++)
                {
                    count++; // 数のカウント
                    TextBox tb = (TextBox)Find(tableLayoutPanel1, "plan" + count);
                    tb.Clear();

                    if (weekNum == j)
                    {
                        dayCountFlag = true;
                    }
                    if (dayCountFlag && dayNum <= dayMaxNum)
                    {
                        string[][] plan = database.displayPlans(Year, Month, dayNum);
                        dayNum++; // 参照したから日付の加算
                        if (plan == null)
                        {
                            continue;
                        }

                        string str = "";

                        for (int k = 0; k < plan.GetLength(0); k++)
                        {
                            if (!(plan[k][0] == ""))
                            {
                                str += plan[k][0] + " ~ " + plan[k][1] + " ";
                            }
                            str += plan[k][2] + Environment.NewLine;
                        }
                        tb.Text          = str;
                        Plans[count - 1] = str;
                    }
                }
            }
            SynchroGoogleCal();
            SetPlansColor();
        }