Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new instance of the Sol_OrderCardLink class and populates it with data from the specified SqlDataReader.
        /// </summary>
        protected virtual Sol_OrderCardLink MakeSol_OrderCardLink(SqlDataReader dataReader)
        {
            Sol_OrderCardLink sol_OrderCardLink = new Sol_OrderCardLink();

            sol_OrderCardLink.CardNumber = SqlClientUtility.GetString(dataReader, "CardNumber", String.Empty);
            sol_OrderCardLink.OrderID    = SqlClientUtility.GetInt32(dataReader, "OrderID", 0);

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

            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@CardNumber", sol_OrderCardLink.CardNumber),
                new SqlParameter("@OrderID", sol_OrderCardLink.OrderID)
            };

            SqlClientUtility.ExecuteNonQuery(connectionStringName, CommandType.StoredProcedure, "Sol_OrderCardLink_Insert", parameters);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Selects all records from the Sol_OrderCardLink table by a foreign key.
        /// </summary>
        public virtual List <Sol_OrderCardLink> SelectAllByCardNumber(string cardNumber)
        {
            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter("@CardNumber", cardNumber)
            };

            using (SqlDataReader dataReader = SqlClientUtility.ExecuteReader(connectionStringName, CommandType.StoredProcedure, "Sol_OrderCardLink_SelectByCardNumber", parameters))
            {
                List <Sol_OrderCardLink> sol_OrderCardLinkList = new List <Sol_OrderCardLink>();
                while (dataReader.Read())
                {
                    Sol_OrderCardLink sol_OrderCardLink = MakeSol_OrderCardLink(dataReader);
                    sol_OrderCardLinkList.Add(sol_OrderCardLink);
                }

                return(sol_OrderCardLinkList);
            }
        }