Beispiel #1
0
        //turn class month static
        public void addDays()
        {
            ClassMonth oMonth = new ClassMonth(nDay, nMonth, nYear);
            int nMonthMaxValue = oMonth.getSpecificMonth(nMonth);

            nDay++;

            if (nDay > nMonthMaxValue)
            {
                nMonth++;
                nDay = 1;

                if (nMonth > 12)
                {
                    nYear++;
                    nMonth = 1;
                }
            }
        }
        private void decrementDay(ref int nCurrentDay, ref  int nCurrentMonth, ref int nCurrentYear)
        {
            ClassMonth oMonth = new ClassMonth(nCurrentDay, nCurrentMonth, nCurrentYear);

            nCurrentDay--;
            if (nCurrentDay < 1)
            {
                //get the previous month maximum days
                int nMonthMaxValue = oMonth.getSpecificMonth(nCurrentMonth > 1 ? nCurrentMonth - 1 : 12);

                nCurrentMonth--;

                nCurrentDay = nMonthMaxValue;

                if (nCurrentMonth < 1)
                {
                    nCurrentYear--;
                    nCurrentMonth = 12;
                }

            }
        }
        private void incrementDay(ref int nCurrentDay, ref  int nCurrentMonth, ref int nCurrentYear)
        {
            ClassMonth oMonth = new ClassMonth(nCurrentDay, nCurrentMonth, nCurrentYear);
            int nMonthMaxValue = oMonth.getSpecificMonth(nCurrentMonth);

            nCurrentDay++;
            if (nCurrentDay > nMonthMaxValue)
            {
                nCurrentMonth++;
                nCurrentDay = 1;

                if (nCurrentMonth > 12)
                {
                    nCurrentYear++;
                    nCurrentMonth = 1;
                }

            }
        }
Beispiel #4
0
        public void decrementDays()
        {
            ClassMonth oMonth = new ClassMonth(nDay, nMonth, nYear);

            nDay--;
            if (nDay < 1)
            {
                //get the previous month maximum days
                int nMonthMaxValue = oMonth.getSpecificMonth(nMonth > 1 ? nMonth - 1 : 12);

                nMonth--;

                nDay = nMonthMaxValue;

                if (nMonth < 1)
                {
                    nYear--;
                    nMonth = 12;
                }
            }
        }