Esempio n. 1
0
        /// <summary>
        /// Updates a MineSiteTopic record and returns the number of records affected
        /// </summary>
        public static int Update(MineSiteTopicDO DO)
        {
            SqlParameter _MineSiteTopicID = new SqlParameter("MineSiteTopicID", SqlDbType.VarChar);
            
            _MineSiteTopicID.Value = DO.MineSiteTopicID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _MineSiteTopicID
            };

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

            return DataCommon.ExecuteScalar("[dbo].[MineSiteTopic_Update]", _params, pid);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new MineSiteTopic record using async
        /// </summary>
        public static async Task CreateAsync(MineSiteTopicDO DO)
        {
            SqlParameter _MineSiteTopicID = new SqlParameter("MineSiteTopicID", SqlDbType.VarChar);
            
            _MineSiteTopicID.Value = DO.MineSiteTopicID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _MineSiteTopicID
            };

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

            await DataCommon.ExecuteNonQueryAsync("[dbo].[MineSiteTopic_Insert]", _params, pid);
            
        }
Esempio n. 3
0
        /// <summary>
        /// Selects MineSiteTopic records by PK
        /// </summary>
        public static async Task<MineSiteTopicDO[]> GetByPKAsync(String MineSiteTopicID)
        {

            SqlParameter _MineSiteTopicID = new SqlParameter("MineSiteTopicID", SqlDbType.VarChar);
			
            _MineSiteTopicID.Value = MineSiteTopicID;
			
            SqlParameter[] _params = new SqlParameter[] {
                _MineSiteTopicID
            };

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

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


            List<MineSiteTopicDO> objs = new List<MineSiteTopicDO>();
			
            while(sr.Read())
            {
                MineSiteTopicDO obj = new MineSiteTopicDO();
				
                obj.MineSiteTopicID = sr.GetString(sr.GetOrdinal("MineSiteTopicID"));
                

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Esempio n. 4
0
        /// <summary>
        /// Gets all MineSiteTopic records
        /// </summary>
        public static async Task<MineSiteTopicDO[]> GetAllAsync()
        {

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

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

                MineSiteTopicDO obj = new MineSiteTopicDO();
                
                obj.MineSiteTopicID = sr.GetString(sr.GetOrdinal("MineSiteTopicID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }