Beispiel #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (IsCorrectData())
     {
         using (clsOvertime overtime = new clsOvertime())
         {
             overtime.Username       = cmbRequestor.SelectedValue.ToString();
             overtime.DateFile       = clsDateTime.CombineDateTime(dtpFileDate.Value, dtpFileTime.Value);
             overtime.DateStart      = clsDateTime.CombineDateTime(dtpStartDate.Value, dtpStartTime.Value);
             overtime.DateEnd        = clsDateTime.CombineDateTime(dtpEndDate.Value, dtpEndTime.Value);
             overtime.Units          = 0;
             overtime.Reason         = txtReason.Text;
             overtime.ChargeType     = cmbChargeType.SelectedValue.ToString();
             overtime.DepartmentCode = cmbRender.SelectedValue.ToString();
             if (cmbChargeType.SelectedValue.ToString() == "1")
             {
                 overtime.RequestorApproverName    = cmbRApprover.SelectedValue.ToString();
                 overtime.RequestorApproverDate    = clsDateTime.CombineDateTime(dtpRDate.Value, dtpRTime.Value);
                 overtime.RequestorApproverRemarks = txtRRemarks.Text;
                 overtime.RequestorApproverStatus  = cmbRStatus.SelectedValue.ToString();
             }
             overtime.HeadApproverName    = cmbHApprover.SelectedValue.ToString();
             overtime.HeadApproverDate    = clsDateTime.CombineDateTime(dtpHDate.Value, dtpHTime.Value);
             overtime.HeadApproverRemarks = txtHRemarks.Text;
             overtime.HeadApproverStatus  = cmbHStatus.SelectedValue.ToString();
             overtime.Status = cmbStatus.SelectedValue.ToString();
             overtime.InsertAdmin();
         }
         _frmOvertimeList.LoadOvertimeList();
         this.Close();
     }
 }
Beispiel #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     using (clsOvertime overtime = new clsOvertime())
     {
         overtime.OvertimeCode = _strOvertimeCode;
         overtime.Fill();
         overtime.DateStart = clsDateTime.CombineDateTime(dtpStartDate.Value, dtpStartTime.Value);
         overtime.DateEnd   = clsDateTime.CombineDateTime(dtpEndDate.Value, dtpEndTime.Value);
         overtime.DateFile  = clsDateTime.CombineDateTime(dtpFileDate.Value, dtpFileTime.Value);
         overtime.Reason    = txtReason.Text;
         if (_strChargeType == "1")
         {
             overtime.RequestorApproverDate    = clsDateTime.CombineDateTime(dtpRDate.Value, dtpRTime.Value);
             overtime.RequestorApproverRemarks = txtRRemarks.Text;
             overtime.RequestorApproverStatus  = cmbRStatus.SelectedValue.ToString();
         }
         overtime.HeadApproverDate    = clsDateTime.CombineDateTime(dtpHDate.Value, dtpHTime.Value);
         overtime.HeadApproverRemarks = txtHRemarks.Text;
         overtime.HeadApproverStatus  = cmbHStatus.SelectedValue.ToString();
         overtime.Status = cmbStatus.SelectedValue.ToString();
         if (overtime.UpdateAdmin() > 0)
         {
             _frmOvertimeList.LoadOvertimeList();
             this.Close();
         }
     }
 }
Beispiel #3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (IsCorrectData())
     {
         using (clsOvertime overtime = new clsOvertime())
         {
             overtime.OvertimeCode   = txtOBCode.Text;
             overtime.Username       = cmbRequestor.SelectedValue.ToString();
             overtime.DateFile       = clsDateTime.CombineDateTime(dtpFileDate.Value, dtpFileTime.Value);
             overtime.DateStart      = clsDateTime.CombineDateTime(dtpStartDate.Value, dtpStartTime.Value);
             overtime.DateEnd        = clsDateTime.CombineDateTime(dtpEndDate.Value, dtpEndTime.Value);
             overtime.Units          = 0;
             overtime.Reason         = txtReason.Text;
             overtime.ChargeType     = cmbChargeType.SelectedValue.ToString();
             overtime.DepartmentCode = cmbRender.SelectedValue.ToString();
             if (cmbChargeType.SelectedValue.ToString() == "1")
             {
                 overtime.RequestorApproverName    = cmbRApprover.SelectedValue.ToString();
                 overtime.RequestorApproverDate    = clsDateTime.CombineDateTime(dtpRDate.Value, dtpRTime.Value);
                 overtime.RequestorApproverRemarks = txtRRemarks.Text;
                 overtime.RequestorApproverStatus  = cmbRStatus.SelectedValue.ToString();
             }
             overtime.HeadApproverName    = cmbHApprover.SelectedValue.ToString();
             overtime.HeadApproverDate    = clsDateTime.CombineDateTime(dtpHDate.Value, dtpHTime.Value);
             overtime.HeadApproverRemarks = txtHRemarks.Text;
             overtime.HeadApproverStatus  = cmbHStatus.SelectedValue.ToString();
             overtime.Status = cmbStatus.SelectedValue.ToString();
             overtime.InsertAdmin();
             if (overtime.MessageAlert == 1)
             {
                 MessageBox.Show("Overtime Request has been added", "Overtime Request Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
         _frmOvertimeList.LoadOvertimeList();
         this.Close();
     }
 }