public override GSCore ExecuteMessage(string token, GSCoreCollection args)
        {
            switch (token)
            {
            case "getEndDone":
            {
                GSCore gtObj = args.getSafe(0);
                if (gtObj != null && gtObj is GregorianDateTime)
                {
                    GregorianDateTime gdt = gtObj as GregorianDateTime;
                    if (gdt.GetJulianInteger() < getView().calStartDate.GetJulianInteger() + 7)
                    {
                        gdt = new GregorianDateTime(getView().calStartDate);
                        gdt.AddDays(7);
                    }
                    getView().calEndDate = gdt;
                    //getView().EndDateText(gdt.ToString());
                    getView().Recalculate();
                }
            }
            break;

            case "getCurrentContent":
                return(getView().getCurrentContent());

            default:
                return(base.ExecuteMessage(token, args));
            }

            return(GSCore.Void);
        }
예제 #2
0
        public CalendarTab()
        {
            InitializeComponent();

            calendarDataView1.Dock  = DockStyle.Fill;
            calendarTableView1.Dock = DockStyle.Fill;
            pictureBox1.Dock        = DockStyle.Fill;


            string s = Properties.Settings.Default.CalendarLocation;

            if (s.Length < 1)
            {
                s = GCGlobal.LastLocation.EncodedString;
            }
            calLocation = new GCLocation();
            calLocation.EncodedString = s;
            s = Properties.Settings.Default.CalendarStartDate;
            if (s.Length > 1)
            {
                calStartDate.EncodedString = s;
            }
            s = Properties.Settings.Default.CalendarEndDate;
            if (s.Length > 1)
            {
                calEndDate.EncodedString = s;
            }

            if ((calStartDate.year < 1500 || calStartDate.year > 3000) ||
                calEndDate.year < 1500 || calEndDate.year > 3000)
            {
                calStartDate     = new GregorianDateTime();
                calStartDate.day = 1;
                calEndDate       = new GregorianDateTime(calStartDate);
                calEndDate.AddDays(60);
            }

            calendarTableView1.calLocation = calLocation;
            calendarTableView1.LiveRefresh = true;

            calendarDataView1.DataSource = this;
            calendarDataView1.InitWithKey("2017-10");

            SetMode(0);
        }
예제 #3
0
        private void d_OnEndDateDone(object sender, EventArgs e)
        {
            if (sender is GregorianDateTime)
            {
                InputEndDate = sender as GregorianDateTime;

                if (InputEndDate.GetJulianInteger() < InputStartDate.GetJulianInteger() + 7)
                {
                    InputEndDate = new GregorianDateTime(InputStartDate);
                    InputEndDate.AddDays(7);
                }

                if (OnPeriodSelected != null)
                {
                    OnPeriodSelected(this, e);
                }
            }
        }
예제 #4
0
 private void toolStripButton6_Click(object sender, EventArgs e)
 {
     selectedDate.AddDays(1);
     StartDateText(selectedDate.ToString());
     Recalculate();
 }