Example #1
0
        public static CustomList <SalaryRule> GetAllSalaryRule()
        {
            ConnectionManager       conManager           = new ConnectionManager(ConnectionName.HR);
            CustomList <SalaryRule> SalaryRuleCollection = new CustomList <SalaryRule>();
            IDataReader             reader = null;
            const String            sql    = "select *from SalaryRule";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    SalaryRule newSalaryRule = new SalaryRule();
                    newSalaryRule.SetData(reader);
                    SalaryRuleCollection.Add(newSalaryRule);
                }
                SalaryRuleCollection.InsertSpName = "spInsertSalaryRule";
                SalaryRuleCollection.UpdateSpName = "spUpdateSalaryRule";
                SalaryRuleCollection.DeleteSpName = "spDeleteSalaryRule";
                return(SalaryRuleCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }