Example #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (dtpDateStart.Value > dtpDateEnd.Value)
            {
                MessageBox.Show("Invalid date.", "HRMS");
            }
            else if (clsValidator.CheckDouble(txtUnit.Text) < 3)
            {
                MessageBox.Show("Leave unit is lower than 3.", "HRMS");
            }
            else
            {
                clsLeave3Days objfrmclsLeave3Days = new clsLeave3Days();
                objfrmclsLeave3Days.LeaveCode = _strLeaveCode;
                objfrmclsLeave3Days.Username  = _strUserName;
                objfrmclsLeave3Days.Unit      = clsValidator.CheckDouble(txtUnit.Text);
                objfrmclsLeave3Days.DateStart = dtpDateStart.Value;
                objfrmclsLeave3Days.DateEnd   = dtpDateEnd.Value;
                objfrmclsLeave3Days.Remarks   = txtRemarks.Text;
                objfrmclsLeave3Days.Enabled   = chkEnabled.Checked == true ? "1" : "0";
                objfrmclsLeave3Days.Update();

                if (_frmCaller == _frmLeave3DayMain)
                {
                    _frmLeave3DayMain.LoadEmployeeLeaveoffense();
                }
                else if (_frmCaller == _mdiIpanema)
                {
                    _mdiIpanema.LoadDSGLeaveNotification();
                    _frmLeave3DayMain.LoadEmployeeLeaveoffense();
                }

                this.Close();
            }
        }
Example #2
0
 public void LoadEmployeeLeaveoffense()
 {
     dgLeaveList.AutoGenerateColumns = false;
     dgLeaveList.DataSource          = clsLeave3Days.GetDSGMainForm();
     if (_strIndicator == "1")
     {
         _mdiIpanema.LoadDSGLeaveNotification();
     }
 }