コード例 #1
0
 private void chkbtnOutdoor_Click(object sender, EventArgs e)
 {
     try
     {
         if (chkbtnOutdoor.Checked)
         {
             frmAddEditLeaveApplication frm = new frmAddEditLeaveApplication();
             frm.EmployeeID                   = _selectedAttendanceRecord.EmployeeID;
             frm.SelectedLeavFormTypeID       = (new ServiceLeaveApplication()).LEAVE_TYPE_OUTDOOR_ID;
             frm.dtLeaveApplicationDate.Value = _selectedAttendanceRecord.AttendanceDate;
             frm.dtFromDate.Value             = frm.dtFromTime.Value = frm.dtToDate.Value = frm.dtToTime.Value = _selectedAttendanceRecord.AttendanceDate;
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 _selectedAttendanceRecord.LeaveApplicationID = frm.LeaveApplicationID;
                 vLeaveApplication leave = (new ServiceLeaveApplication()).GetLeaveApplicationInfoViewRecord(_selectedAttendanceRecord.LeaveApplicationID);
                 txtRemarks.Text       = string.Format("{0} ({1})", leave.LeaveFormTypeName, leave.LeaveTypeName);
                 dtOnSiteInTime.Value  = leave.FromTime.Value;
                 dtOnSiteOutTime.Value = leave.ToTime.Value;
             }
         }
     }
     catch (Exception ex)
     {
         string errMessage = ex.Message;
         if (ex.InnerException != null)
         {
             errMessage += string.Format("\n\n{0}", ex.InnerException.Message);
         }
         MessageBox.Show(errMessage, "PageDailyAttendance::chkbtnOutdoor_Click", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #2
0
        private void btnDetails_Click(object sender, EventArgs e)
        {
            try
            {
                ServiceLeaveApplication service = new ServiceLeaveApplication();
                //before invoking form pass employee and lave form type id
                frmAddEditLeaveApplication frm = new frmAddEditLeaveApplication();
                frm.EmployeeID = this.selectedOnSiteEmployeeID;
                switch (this.selectedAttendanceTYPE)
                {
                case ATTENDANCE_TYPE.LEAVE:
                    frm.SelectedLeavFormTypeID = service.LEAVE_TYPE_LEAVE_ID;
                    break;

                case ATTENDANCE_TYPE.OUT_DOOR:
                    frm.SelectedLeavFormTypeID = service.LEAVE_TYPE_OUTDOOR_ID;
                    break;
                }
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    OnSiteAttendanceModel model = new OnSiteAttendanceModel();
                    listOnSiteATTENDANCE.Add(model);
                }
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "PageDailyAttendance::btnDetails_Click", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private void chkbtnLeave_Click(object sender, EventArgs e)
        {
            chkbtnPresent.Checked = false;
            chkbtnAbsent.Checked  = false;
            chkbtnOutdoor.Checked = false;
            try
            {
                frmAddEditLeaveApplication frm = null;
                if (chkbtnLeave.Checked)
                {
                    selectedLeaveType = true;
                    if (_selectedAttendanceRecord.LeaveApplicationID == 0)
                    {
                        frm                              = new frmAddEditLeaveApplication();
                        frm.EmployeeID                   = _selectedAttendanceRecord.EmployeeID;
                        frm.SelectedLeavFormTypeID       = (new ServiceLeaveApplication()).LEAVE_TYPE_LEAVE_ID;
                        frm.dtLeaveApplicationDate.Value = _selectedAttendanceRecord.AttendanceDate;
                        frm.dtFromDate.Value             = frm.dtFromTime.Value = frm.dtToDate.Value = frm.dtToTime.Value = _selectedAttendanceRecord.AttendanceDate;

                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            _selectedAttendanceRecord.LeaveApplicationID = frm.LeaveApplicationID;
                            vLeaveApplication leave = (new ServiceLeaveApplication()).GetLeaveApplicationInfoViewRecord(_selectedAttendanceRecord.LeaveApplicationID);
                            txtRemarks.Text = string.Format("{0} ({1})", leave.LeaveFormTypeName, leave.LeaveTypeName);
                            _selectedAttendanceRecord.AttendanceType = ATTENDANCE_TYPE.LEAVE;

                            dtOnSiteInTime.Value  = leave.FromTime.Value;
                            dtOnSiteOutTime.Value = leave.ToTime.Value;
                        }
                    }
                    else
                    {
                        //frm = new frmAddEditLeaveApplication(_selectedAttendanceRecord.LeaveApplicationID);
                        MessageBox.Show("LEAVE is already entered...", "Caution", MessageBoxButtons.OK);
                    }
                }
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "PageManualAttendance::chkbtnLeave_CheckedChanged", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
 private void btnEditLeave_Click(object sender, EventArgs e)
 {
     try
     {
         frmAddEditLeaveApplication frm = new frmAddEditLeaveApplication(this.SelectedLeaveAppliID);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             PopulateLeavesGrid();
         }
     }
     catch (Exception ex)
     {
         string errMessage = ex.Message;
         if (ex.InnerException != null)
         {
             errMessage += string.Format("\n{0}", ex.InnerException.Message);
         }
         MessageBox.Show(errMessage, "PageUserInfo::btnEditLeave_Click", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }