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

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

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

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

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

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

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

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


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

                objs.Add(obj);
            }

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

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

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

                AddressTypeDO obj = new AddressTypeDO();
                
                obj.AddressTypeID = sr.GetString(sr.GetOrdinal("AddressTypeID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }