public BsDate AddDays(int noOfDay) // overload to asign to another date { BsDate newBs = new BsDate(EngDate); newBs.EngDate = newBs._engDate.AddDays(noOfDay); return(newBs); }
private void lblToday_click(object sender, EventArgs e) { Value = new BsDate(DateTime.Now); txtDate.Text = _ucValue.ToString(); //close calender ShowHideCalender(false); }
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; }
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); } }
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; }
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); }
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); }
private void txtDate_Leave(object sender, EventArgs e) { Value = new BsDate(txtDate.Text); }