Exemplo n.º 1
0
        public static CustomList <SalaryHead> GetAllSalaryHeadForMisc()
        {
            ConnectionManager       conManager           = new ConnectionManager(ConnectionName.HR);
            CustomList <SalaryHead> SalaryHeadCollection = new CustomList <SalaryHead>();
            IDataReader             reader = null;
            const String            sql    = "EXEC GetAllSalaryHead";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    SalaryHead newSalaryHead = new SalaryHead();
                    newSalaryHead.SetDataMisc(reader);
                    SalaryHeadCollection.Add(newSalaryHead);
                }
                return(SalaryHeadCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 2
0
        public static CustomList <SalaryHead> GetAllSalaryHead()
        {
            ConnectionManager       conManager           = new ConnectionManager(ConnectionName.HR);
            CustomList <SalaryHead> SalaryHeadCollection = new CustomList <SalaryHead>();
            IDataReader             reader = null;
            const String            sql    = "select * from SalaryHead";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    SalaryHead newSalaryHead = new SalaryHead();
                    newSalaryHead.SetData(reader);
                    SalaryHeadCollection.Add(newSalaryHead);
                }
                SalaryHeadCollection.InsertSpName = "spInsertSalaryHead";
                SalaryHeadCollection.UpdateSpName = "spUpdateSalaryHead";
                SalaryHeadCollection.DeleteSpName = "spDeleteSalaryHead";
                return(SalaryHeadCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }