public static CustomList <LeaveTransApproved> GetUnApprovedDayLeaves(string empKey) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <LeaveTransApproved> LeaveTransApprovedCollection = new CustomList <LeaveTransApproved>(); IDataReader reader = null; String sql = "exec spGetDayLeavesRepotiee '" + empKey + "'"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { LeaveTransApproved newLeaveTransApproved = new LeaveTransApproved(); newLeaveTransApproved.SetDataDayLeaves(reader); LeaveTransApprovedCollection.Add(newLeaveTransApproved); } return(LeaveTransApprovedCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <LeaveTransApproved> GetLeaveEligibleEmp(string EmployeeCode) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <LeaveTransApproved> LeaveTransApprovedCollection = new CustomList <LeaveTransApproved>(); IDataReader reader = null; String sql = "exec spGetEligibleEmpForLeaveTrans '" + EmployeeCode + "'"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { LeaveTransApproved newLeaveTransApproved = new LeaveTransApproved(); newLeaveTransApproved.SetData2(reader); LeaveTransApprovedCollection.Add(newLeaveTransApproved); } return(LeaveTransApprovedCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }