Beispiel #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     using (Holiday objHoliday = new Holiday())
     {
         objHoliday.HolidayCode = txtHolidayCode.Text;
         objHoliday.DateApplied = clsDateTime.GetDateOnly(dteDateApplied.Value);
         objHoliday.ShiftCode   = cmbShift.SelectedValue.ToString();
         objHoliday.Description = txtRemarks.Text;
         objHoliday.Insert();
         _frmHolidayList.BindHolidayList();
         this.Close();
     }
 }
Beispiel #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     using (Holiday objHoliday = new Holiday())
     {
         objHoliday.HolidayCode = txtHolidayCode.Text;
         objHoliday.Fill();
         objHoliday.ShiftCode   = cmbShift.SelectedValue.ToString();
         objHoliday.Description = txtDescription.Text;
         if (objHoliday.Update() >= 1)
         {
             _frmHolidayList.BindHolidayList();
             this.Close();
         }
         else
         {
             MessageBox.Show(clsMessageBox.MessageBoxErrorAdd, clsMessageBox.MessageBoxText, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
     }
 }