Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new TOCLayer record using async
        /// </summary>
        public static async Task<int> CreateAsync(TOCLayerDO DO)
        {
            SqlParameter _Section = new SqlParameter("Section", SqlDbType.VarChar);
            SqlParameter _SubSection = new SqlParameter("SubSection", SqlDbType.VarChar);
            SqlParameter _LayerID = new SqlParameter("LayerID", SqlDbType.VarChar);
            SqlParameter _TOCID = new SqlParameter("TOCID", SqlDbType.Int);
            
            _Section.Value = DO.Section;
            _SubSection.Value = DO.SubSection;
            _LayerID.Value = DO.LayerID;
            _TOCID.Value = DO.TOCID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _Section,
                _SubSection,
                _LayerID,
                _TOCID
            };

            string pid = ConfigurationManager.AppSettings["ePermitDAL"];

            return await DataCommon.ExecuteScalarAsync("[dbo].[TOCLayer_Insert]", _params, pid);
            
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets all TOCLayer records
        /// </summary>
        public static async Task<TOCLayerDO[]> GetAllAsync()
        {

            string pid = ConfigurationManager.AppSettings["ePermitDAL"];

            SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[TOCLayer_GetAll]", new SqlParameter[] { }, pid);
            
            List<TOCLayerDO> objs = new List<TOCLayerDO>();
            
            while(sr.Read()){

                TOCLayerDO obj = new TOCLayerDO();
                
                obj.TOCLayerID = sr.GetInt32(sr.GetOrdinal("TOCLayerID"));
                obj.Section = sr.GetString(sr.GetOrdinal("Section"));
                obj.SubSection = sr.GetString(sr.GetOrdinal("SubSection"));
                obj.LayerID = sr.GetString(sr.GetOrdinal("LayerID"));
                obj.TOCID = sr.GetInt32(sr.GetOrdinal("TOCID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Selects TOCLayer records by TOCID
        /// </summary>
        public static async Task<TOCLayerDO[]> GetByTOCIDAsync(Int32 TOCID)
        {

            SqlParameter _TOCID = new SqlParameter("TOCID", SqlDbType.Int);
			
            _TOCID.Value = TOCID;
			
            SqlParameter[] _params = new SqlParameter[] {
                _TOCID
            };

            string pid = ConfigurationManager.AppSettings["ePermitDAL"];

            SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[TOCLayer_GetByTOCID]", _params, pid);


            List<TOCLayerDO> objs = new List<TOCLayerDO>();
			
            while(sr.Read())
            {
                TOCLayerDO obj = new TOCLayerDO();
				
                obj.TOCLayerID = sr.GetInt32(sr.GetOrdinal("TOCLayerID"));
                obj.Section = sr.GetString(sr.GetOrdinal("Section"));
                obj.SubSection = sr.GetString(sr.GetOrdinal("SubSection"));
                obj.LayerID = sr.GetString(sr.GetOrdinal("LayerID"));
                obj.TOCID = sr.GetInt32(sr.GetOrdinal("TOCID"));
                

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Deletes a TOCLayer record
        /// </summary>
        public static async Task<int> DeleteAsync(TOCLayerDO DO)
        {
            SqlParameter _TOCLayerID = new SqlParameter("TOCLayerID", SqlDbType.Int);
            
            _TOCLayerID.Value = DO.TOCLayerID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _TOCLayerID
            };

            string pid = ConfigurationManager.AppSettings["ePermitDAL"];

            return await DataCommon.ExecuteScalarAsync("[dbo].[TOCLayer_Delete]", _params, pid);
        }