Example #1
0
        /// <summary>
        /// Updates a Direction record and returns the number of records affected
        /// </summary>
        public static int Update(DirectionDO DO)
        {
            SqlParameter _DirectionID = new SqlParameter("DirectionID", SqlDbType.VarChar);
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);
            
            _DirectionID.Value = DO.DirectionID;
            _Description.Value = DO.Description;
            
            SqlParameter[] _params = new SqlParameter[] {
                _DirectionID,
                _Description
            };

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

            return DataCommon.ExecuteScalar("[dbo].[Direction_Update]", _params, pid);
        }
Example #2
0
        /// <summary>
        /// Creates a new Direction record using async
        /// </summary>
        public static async Task CreateAsync(DirectionDO DO)
        {
            SqlParameter _DirectionID = new SqlParameter("DirectionID", SqlDbType.VarChar);
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);
            
            _DirectionID.Value = DO.DirectionID;
            _Description.Value = DO.Description;
            
            SqlParameter[] _params = new SqlParameter[] {
                _DirectionID,
                _Description
            };

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

            await DataCommon.ExecuteNonQueryAsync("[dbo].[Direction_Insert]", _params, pid);
            
        }
Example #3
0
        /// <summary>
        /// Gets all Direction records
        /// </summary>
        public static async Task<DirectionDO[]> GetAllAsync()
        {

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

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

                DirectionDO obj = new DirectionDO();
                
                obj.DirectionID = sr.GetString(sr.GetOrdinal("DirectionID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }
Example #4
0
        /// <summary>
        /// Selects Direction records by PK
        /// </summary>
        public static async Task<DirectionDO[]> GetByPKAsync(String DirectionID)
        {

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

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

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


            List<DirectionDO> objs = new List<DirectionDO>();
			
            while(sr.Read())
            {
                DirectionDO obj = new DirectionDO();
				
                obj.DirectionID = sr.GetString(sr.GetOrdinal("DirectionID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));
                

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Example #5
0
        /// <summary>
        /// Deletes a Direction record
        /// </summary>
        public static async Task<int> DeleteAsync(DirectionDO DO)
        {
            SqlParameter _DirectionID = new SqlParameter("DirectionID", SqlDbType.VarChar);
            
            _DirectionID.Value = DO.DirectionID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _DirectionID
            };

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

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