Esempio n. 1
0
        /// <summary>
        /// Creates a new instance of the Vir_Conveyor class and populates it with data from the specified SqlDataReader.
        /// </summary>
        protected virtual Vir_Conveyor MakeVir_Conveyor(SqlDataReader dataReader)
        {
            Vir_Conveyor vir_Conveyor = new Vir_Conveyor();

            vir_Conveyor.ConveyorID          = SqlClientUtility.GetInt32(dataReader, "ConveyorID", 0);
            vir_Conveyor.ConveyorDescription = SqlClientUtility.GetString(dataReader, "ConveyorDescription", String.Empty);

            return(vir_Conveyor);
        }
Esempio n. 2
0
        /// <summary>
        /// Saves a record to the Vir_Conveyor table.
        /// </summary>
        public virtual void Insert(Vir_Conveyor vir_Conveyor)
        {
            ValidationUtility.ValidateArgument("vir_Conveyor", vir_Conveyor);

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@ConveyorDescription", vir_Conveyor.ConveyorDescription)
            };

            vir_Conveyor.ConveyorID = (int)SqlClientUtility.ExecuteScalar(connectionStringName, CommandType.StoredProcedure, "Vir_Conveyor_Insert", parameters);
        }
Esempio n. 3
0
        /// <summary>
        /// Updates a record in the Vir_Conveyor table.
        /// </summary>
        public virtual void Update(Vir_Conveyor vir_Conveyor)
        {
            ValidationUtility.ValidateArgument("vir_Conveyor", vir_Conveyor);

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@ConveyorID", vir_Conveyor.ConveyorID),
                new SqlParameter("@ConveyorDescription", vir_Conveyor.ConveyorDescription)
            };

            SqlClientUtility.ExecuteNonQuery(connectionStringName, CommandType.StoredProcedure, "Vir_Conveyor_Update", parameters);
        }
Esempio n. 4
0
        /// <summary>
        /// Selects all records from the Vir_Conveyor table.
        /// </summary>
        public virtual List <Vir_Conveyor> SelectAll()
        {
            using (SqlDataReader dataReader = SqlClientUtility.ExecuteReader(connectionStringName, CommandType.StoredProcedure, "Vir_Conveyor_SelectAll"))
            {
                List <Vir_Conveyor> vir_ConveyorList = new List <Vir_Conveyor>();
                while (dataReader.Read())
                {
                    Vir_Conveyor vir_Conveyor = MakeVir_Conveyor(dataReader);
                    vir_ConveyorList.Add(vir_Conveyor);
                }

                return(vir_ConveyorList);
            }
        }