示例#1
0
        /// <summary>
        /// Updates a PermitStatus record and returns the number of records affected
        /// </summary>
        public static int Update(PermitStatusDO DO)
        {
            SqlParameter _PermitStatusID = new SqlParameter("PermitStatusID", SqlDbType.VarChar);
            
            _PermitStatusID.Value = DO.PermitStatusID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _PermitStatusID
            };

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

            return DataCommon.ExecuteScalar("[dbo].[PermitStatus_Update]", _params, pid);
        }
示例#2
0
        /// <summary>
        /// Creates a new PermitStatus record using async
        /// </summary>
        public static async Task CreateAsync(PermitStatusDO DO)
        {
            SqlParameter _PermitStatusID = new SqlParameter("PermitStatusID", SqlDbType.VarChar);
            
            _PermitStatusID.Value = DO.PermitStatusID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _PermitStatusID
            };

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

            await DataCommon.ExecuteNonQueryAsync("[dbo].[PermitStatus_Insert]", _params, pid);
            
        }
示例#3
0
        /// <summary>
        /// Selects PermitStatus records by PK
        /// </summary>
        public static async Task<PermitStatusDO[]> GetByPKAsync(String PermitStatusID)
        {

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

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

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


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

                objs.Add(obj);
            }

            return objs.ToArray();
        }
示例#4
0
        /// <summary>
        /// Gets all PermitStatus records
        /// </summary>
        public static async Task<PermitStatusDO[]> GetAllAsync()
        {

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

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

                PermitStatusDO obj = new PermitStatusDO();
                
                obj.PermitStatusID = sr.GetString(sr.GetOrdinal("PermitStatusID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }