예제 #1
0
        /// <summary>
        /// Updates a ApplicationType record and returns the number of records affected
        /// </summary>
        public static int Update(ApplicationTypeDO DO)
        {
            SqlParameter _ApplicationTypeID = new SqlParameter("ApplicationTypeID", SqlDbType.VarChar);
            
            _ApplicationTypeID.Value = DO.ApplicationTypeID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _ApplicationTypeID
            };

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

            return DataCommon.ExecuteScalar("[dbo].[ApplicationType_Update]", _params, pid);
        }
예제 #2
0
        /// <summary>
        /// Creates a new ApplicationType record using async
        /// </summary>
        public static async Task CreateAsync(ApplicationTypeDO DO)
        {
            SqlParameter _ApplicationTypeID = new SqlParameter("ApplicationTypeID", SqlDbType.VarChar);
            
            _ApplicationTypeID.Value = DO.ApplicationTypeID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _ApplicationTypeID
            };

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

            await DataCommon.ExecuteNonQueryAsync("[dbo].[ApplicationType_Insert]", _params, pid);
            
        }
예제 #3
0
        /// <summary>
        /// Selects ApplicationType records by PK
        /// </summary>
        public static async Task<ApplicationTypeDO[]> GetByPKAsync(String ApplicationTypeID)
        {

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

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

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


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

                objs.Add(obj);
            }

            return objs.ToArray();
        }
예제 #4
0
        /// <summary>
        /// Gets all ApplicationType records
        /// </summary>
        public static async Task<ApplicationTypeDO[]> GetAllAsync()
        {

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

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

                ApplicationTypeDO obj = new ApplicationTypeDO();
                
                obj.ApplicationTypeID = sr.GetString(sr.GetOrdinal("ApplicationTypeID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }