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

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

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

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

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

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

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

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


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

                objs.Add(obj);
            }

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

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

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

                MineTypeDO obj = new MineTypeDO();
                
                obj.MineTypeID = sr.GetString(sr.GetOrdinal("MineTypeID"));
                


                objs.Add(obj);
            }

            return objs.ToArray();
        }