private void sbtnLeaveEdit_Click(object sender, System.EventArgs e) { if (!CheckGvLeaveFocusRow()) return; DataRow rLeave = gvLeave.GetDataRow(gvLeave.FocusedRowHandle); if (Convert.ToInt32(rLeave["nStatusID"]) != 0) { UI.ShowErrorMessage(this, "You can edit Pending Approval leave only."); return; } int nLeaveID = Convert.ToInt32(rLeave["nLeaveID"]); ACMS.ACMSStaff.Leave.frmLeave frm = new ACMS.ACMSStaff.Leave.frmLeave(nLeaveID, ACMS.Convert.ToInt32(luedtLeaveEmployeeID.EditValue), myLeaveEmployeeInfo); frm.Text = "Edit Leave"; frm.LeaveType = rLeave["strLeaveCode"]; frm.StartDate = Convert.ToDateTime(rLeave["dtStartTime"]); frm.StartTime = Convert.ToDateTime(rLeave["dtStartTime"]); frm.EndTime = Convert.ToDateTime(rLeave["dtEndTime"]); frm.Reason = rLeave["strRemarks"].ToString(); frm.IsHalfDay = !System.Convert.ToBoolean(rLeave["fFullDay"]); if (System.Convert.ToBoolean(rLeave["fFullDay"])) frm.EnableTime = false; if (System.Convert.ToBoolean(rLeave["fTimeOff"])) { frm.ShowIsHalfDay = false; frm.EnableTime = true; } if (DialogResult.Cancel != frm.ShowDialog()) RefreshLeave(); frm.Dispose(); }
private void sbtnLeaveApply_Click(object sender, System.EventArgs e) { ACMS.ACMSStaff.Leave.frmLeave form = new ACMS.ACMSStaff.Leave.frmLeave(-1, ACMS.Convert.ToInt32(luedtLeaveEmployeeID.EditValue), myLeaveEmployeeInfo); if (DialogResult.OK == form.ShowDialog()) RefreshLeave(); form.Dispose(); }