コード例 #1
0
        /// <summary>
        /// Updates a OtherPermitStatus record and returns the number of records affected
        /// </summary>
        public static int Update(OtherPermitStatusDO DO)
        {
            SqlParameter _OtherPermitStatusID = new SqlParameter("OtherPermitStatusID", SqlDbType.VarChar);
            
            _OtherPermitStatusID.Value = DO.OtherPermitStatusID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _OtherPermitStatusID
            };

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

            return DataCommon.ExecuteScalar("[dbo].[OtherPermitStatus_Update]", _params, pid);
        }
コード例 #2
0
        /// <summary>
        /// Creates a new OtherPermitStatus record using async
        /// </summary>
        public static async Task CreateAsync(OtherPermitStatusDO DO)
        {
            SqlParameter _OtherPermitStatusID = new SqlParameter("OtherPermitStatusID", SqlDbType.VarChar);
            
            _OtherPermitStatusID.Value = DO.OtherPermitStatusID;
            
            SqlParameter[] _params = new SqlParameter[] {
                _OtherPermitStatusID
            };

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

            await DataCommon.ExecuteNonQueryAsync("[dbo].[OtherPermitStatus_Insert]", _params, pid);
            
        }
コード例 #3
0
        /// <summary>
        /// Selects OtherPermitStatus records by PK
        /// </summary>
        public static async Task<OtherPermitStatusDO[]> GetByPKAsync(String OtherPermitStatusID)
        {

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

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

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


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

                objs.Add(obj);
            }

            return objs.ToArray();
        }
コード例 #4
0
        /// <summary>
        /// Gets all OtherPermitStatus records
        /// </summary>
        public static async Task<OtherPermitStatusDO[]> GetAllAsync()
        {

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

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

                OtherPermitStatusDO obj = new OtherPermitStatusDO();
                
                obj.OtherPermitStatusID = sr.GetString(sr.GetOrdinal("OtherPermitStatusID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }