public static CustomList <TransferAndPromotionHistory> GetAllExistingInfoForPromotion(string EmpCode, int promotionOrTransferCritaria) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <TransferAndPromotionHistory> TransferAndPromotionHistoryCollection = new CustomList <TransferAndPromotionHistory>(); IDataReader reader = null; String sql = "exec spGetPromotionCriteria '" + EmpCode + "'";// +promotionOrTransferCritaria; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { TransferAndPromotionHistory newTransferAndPromotionHistory = new TransferAndPromotionHistory(); newTransferAndPromotionHistory.SetData2(reader); TransferAndPromotionHistoryCollection.Add(newTransferAndPromotionHistory); } return(TransferAndPromotionHistoryCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <TransferAndPromotionHistory> GetAllTransferAndPromotionHistory() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <TransferAndPromotionHistory> TransferAndPromotionHistoryCollection = new CustomList <TransferAndPromotionHistory>(); IDataReader reader = null; const String sql = "select * from TransferAndPromotionHistory"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { TransferAndPromotionHistory newTransferAndPromotionHistory = new TransferAndPromotionHistory(); newTransferAndPromotionHistory.SetData(reader); TransferAndPromotionHistoryCollection.Add(newTransferAndPromotionHistory); } return(TransferAndPromotionHistoryCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <TransferAndPromotionHistory> GetAllEmpForPromotionApproval() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <TransferAndPromotionHistory> TransferAndPromotionHistoryCollection = new CustomList <TransferAndPromotionHistory>(); IDataReader reader = null; String sql = "exec spGetPromotionEmp"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { TransferAndPromotionHistory newTransferAndPromotionHistory = new TransferAndPromotionHistory(); newTransferAndPromotionHistory.EmpKey = reader.GetInt64("EmpKey"); newTransferAndPromotionHistory.EmpCode = reader.GetString("EmpCode"); newTransferAndPromotionHistory.EmpName = reader.GetString("EmpName"); newTransferAndPromotionHistory.DOJ = reader.GetDateTime("DOJ"); newTransferAndPromotionHistory.Designation = reader.GetString("Designation"); newTransferAndPromotionHistory.Department = reader.GetString("Department"); newTransferAndPromotionHistory.ElementName = reader.GetString("ElementName"); newTransferAndPromotionHistory.EffectiveDate = reader.GetDateTime("EffectiveDate"); newTransferAndPromotionHistory.AddedBy = reader.GetString("AddedBy"); newTransferAndPromotionHistory.AddedDate = reader.GetDateTime("AddedDate"); TransferAndPromotionHistoryCollection.Add(newTransferAndPromotionHistory); } return(TransferAndPromotionHistoryCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <TransferAndPromotionHistory> GetAllPromotionApproval() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <TransferAndPromotionHistory> TransferAndPromotionHistoryCollection = new CustomList <TransferAndPromotionHistory>(); IDataReader reader = null; String sql = "exec spGetPromotionApproval"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { TransferAndPromotionHistory newTransferAndPromotionHistory = new TransferAndPromotionHistory(); newTransferAndPromotionHistory.EmpKey = reader.GetInt64("EmpKey"); newTransferAndPromotionHistory.EntityID = reader.GetInt32("EntityID"); newTransferAndPromotionHistory.EntityName = reader.GetString("EntityName"); newTransferAndPromotionHistory.PreHKEntryID = reader.GetInt32("PreHKEntryID"); newTransferAndPromotionHistory.PreHKEntryName = reader.GetString("PreHKEntryName"); newTransferAndPromotionHistory.CurrentHKEntryID = reader.GetInt32("CurrentHKEntryID"); newTransferAndPromotionHistory.CurrentHKEntryName = reader.GetString("CurrentHKEntryName"); TransferAndPromotionHistoryCollection.Add(newTransferAndPromotionHistory); } return(TransferAndPromotionHistoryCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }