public static List <Payrollcomponent> GetPayrollComponentList() { List <Payrollcomponent> ComponentList = new List <Payrollcomponent>(); DataTable ComponentTable = PayrollComponentDataAccess.GetInstance.GetPayrollComponentList(); foreach (DataRow dr in ComponentTable.Rows) { Payrollcomponent TheComponent = DataRowToObject(dr); ComponentList.Add(TheComponent); } return(ComponentList); }
public static Payrollcomponent DataRowToObject(DataRow dr) { Payrollcomponent TheComponent = new Payrollcomponent(); TheComponent.PayComponentID = int.Parse(dr["PayComponentID"].ToString()); TheComponent.PayComponentDescription = dr["PayComponentDescription"].ToString(); TheComponent.PayComponentType = dr["PayComponentType"].ToString(); TheComponent.AddedByName = dr["AddedByName"].ToString(); TheComponent.AddedByCode = dr["AddedByCode"].ToString(); return(TheComponent); }