Exemplo n.º 1
0
        public static CustomList <SeparationGrid> GetAllUnapprovedSeparation()
        {
            ConnectionManager           conManager           = new ConnectionManager(ConnectionName.HR);
            CustomList <SeparationGrid> SeparationCollection = new CustomList <SeparationGrid>();
            IDataReader  reader = null;
            const String sql    = "select * from Separation Where ApprovedBy IS NULL And ApprovedDate IS NULL";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    SeparationGrid newSeparation = new SeparationGrid();
                    newSeparation.SetData(reader);
                    SeparationCollection.Add(newSeparation);
                }
                SeparationCollection.InsertSpName = "spInsertSeparation";
                SeparationCollection.UpdateSpName = "spUpdateSeparation";
                SeparationCollection.DeleteSpName = "spDeleteSeparation";
                return(SeparationCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 2
0
        public static CustomList <SeparationGrid> GetAllSeparationGrid()
        {
            ConnectionManager           conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <SeparationGrid> SeparationGridCollection = new CustomList <SeparationGrid>();
            IDataReader  reader = null;
            const String sql    = "exec spProcSeparationGrid";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    SeparationGrid newSeparationGrid = new SeparationGrid();
                    newSeparationGrid.SetData(reader);
                    SeparationGridCollection.Add(newSeparationGrid);
                }
                SeparationGridCollection.InsertSpName = "spInsertSeparationGrid";
                SeparationGridCollection.UpdateSpName = "spUpdateSeparationGrid";
                SeparationGridCollection.DeleteSpName = "spDeleteSeparationGrid";
                return(SeparationGridCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }