Exemplo n.º 1
0
        /// <summary>
        /// Updates a ContactClass record and returns the number of records affected
        /// </summary>
        public static int Update(ContactClassDO DO)
        {
            SqlParameter _ContactClassID = new SqlParameter("ContactClassID", SqlDbType.VarChar);
            
            _ContactClassID.Value = DO.ContactClassID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _ContactClassID
            };

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

            return DataCommon.ExecuteScalar("[dbo].[ContactClass_Update]", _params, pid);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new ContactClass record using async
        /// </summary>
        public static async Task CreateAsync(ContactClassDO DO)
        {
            SqlParameter _ContactClassID = new SqlParameter("ContactClassID", SqlDbType.VarChar);
            
            _ContactClassID.Value = DO.ContactClassID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _ContactClassID
            };

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

            await DataCommon.ExecuteNonQueryAsync("[dbo].[ContactClass_Insert]", _params, pid);
            
        }
Exemplo n.º 3
0
        /// <summary>
        /// Selects ContactClass records by PK
        /// </summary>
        public static async Task<ContactClassDO[]> GetByPKAsync(String ContactClassID)
        {

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

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

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


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

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets all ContactClass records
        /// </summary>
        public static async Task<ContactClassDO[]> GetAllAsync()
        {

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

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

                ContactClassDO obj = new ContactClassDO();
                
                obj.ContactClassID = sr.GetString(sr.GetOrdinal("ContactClassID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }