Esempio n. 1
0
        public BsDate AddDays(int noOfDay) // overload to asign to another date
        {
            BsDate newBs = new BsDate(EngDate);

            newBs.EngDate = newBs._engDate.AddDays(noOfDay);
            return(newBs);
        }
Esempio n. 2
0
 private void lblToday_click(object sender, EventArgs e)
 {
     Value        = new BsDate(DateTime.Now);
     txtDate.Text = _ucValue.ToString();
     //close calender
     ShowHideCalender(false);
 }
Esempio n. 3
0
        private void Setup()
        {
            Value = new BsDate(DateTime.Now);
            //Calender panel is of 235*205

            this.Height     = txtDate.Height;
            pnlDateBox.Dock = DockStyle.Fill;
            prev_font       = this.Font;
        }
Esempio n. 4
0
 private void lblMonthPrev_Click(object sender, EventArgs e)
 {
     if (_currentMonth == 1)
     {
         cmbYear.SelectedItem  = Convert.ToInt32(cmbYear.Text) + -1;
         cmbMonth.SelectedItem = BsDate.GetMonthNameByValue(12);
     }
     else
     {
         cmbMonth.SelectedItem = BsDate.GetMonthNameByValue(_currentMonth - 1);
     }
 }
Esempio n. 5
0
        private void AddItemOnList()
        {
            for (int i = 2000; i < 2101; i++)
            {
                cmbYear.Items.Add(i);
            }
            for (int j = 1; j < 13; j++)
            {
                cmbMonth.Items.Add(BsDate.GetMonthNameByValue(j));
            }

            cmbMonth.MaxDropDownItems = 8;
            cmbYear.MaxDropDownItems  = 8;
        }
Esempio n. 6
0
        public BsDate AddMonth(int noOfMonth)
        {
            BsDate newBs = new BsDate(EngDate);

            int goingMonth = newBs._month + noOfMonth;

            if (goingMonth > 12)
            {
                int yToAdd = goingMonth / 12;
                newBs._year = newBs._year + yToAdd;

                goingMonth = goingMonth % 12 + 1;
            }
            newBs.Month = goingMonth;

            return(newBs);
        }
Esempio n. 7
0
        private void day_Click(object sender, EventArgs e)
        {
            string m = _currentMonth.ToString();
            string d = ((Label)sender).Text.Trim();

            if (d == "")
            {
                return;
            }

            if (m.Length < 2)
            {
                m = "0" + m;
            }
            if (d.Length < 2)
            {
                d = "0" + d;
            }
            txtDate.Text = cmbYear.SelectedItem + @"/" + m + @"/" + d;
            Value        = new BsDate(txtDate.Text);
            // hide calender
            ShowHideCalender(false);
        }
Esempio n. 8
0
 private void txtDate_Leave(object sender, EventArgs e)
 {
     Value = new BsDate(txtDate.Text);
 }