Ejemplo n.º 1
0
        /// <summary>
        /// Deletes a Direction record
        /// </summary>
        public static int Delete(DirectionDO DO)
        {
            SqlParameter _DirectionID = new SqlParameter("DirectionID", SqlDbType.VarChar);

            _DirectionID.Value = DO.DirectionID;

            SqlParameter[] _params = new SqlParameter[] {
                _DirectionID
            };

            return DataCommon.ExecuteScalar("[dbo].[Direction_Delete]", _params, "dbo");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new Direction record
        /// </summary>
        public static void Create(DirectionDO DO)
        {
            SqlParameter _DirectionID = new SqlParameter("DirectionID", SqlDbType.VarChar);
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);

            _DirectionID.Value = DO.DirectionID;
            _Description.Value = DO.Description;

            SqlParameter[] _params = new SqlParameter[] {
                _DirectionID,
                _Description
            };

            DataCommon.ExecuteNonQuery("[dbo].[Direction_Insert]", _params, "dbo");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets all Direction records
        /// </summary>
        public static DirectionDO[] GetAll()
        {
            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[Direction_GetAll]", new SqlParameter[] { }, "dbo");

            List<DirectionDO> objs = new List<DirectionDO>();

            while(sr.Read()){

                DirectionDO obj = new DirectionDO();

                obj.DirectionID = sr.GetString(sr.GetOrdinal("DirectionID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Selects Direction records by PK
        /// </summary>
        public static DirectionDO[] GetByPK(String DirectionID)
        {
            SqlParameter _DirectionID = new SqlParameter("DirectionID", SqlDbType.VarChar);

            _DirectionID.Value = DirectionID;

            SqlParameter[] _params = new SqlParameter[] {
                _DirectionID
            };

            SafeReader sr = DataCommon.ExecuteSafeReader("[dbo].[Direction_GetByPK]", _params, "dbo");

            List<DirectionDO> objs = new List<DirectionDO>();

            while(sr.Read())
            {
                DirectionDO obj = new DirectionDO();

                obj.DirectionID = sr.GetString(sr.GetOrdinal("DirectionID"));
                obj.Description = sr.GetString(sr.GetOrdinal("Description"));

                objs.Add(obj);
            }

            return objs.ToArray();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Updates a Direction record and returns the number of records affected
        /// </summary>
        public static int Update(DirectionDO DO)
        {
            SqlParameter _DirectionID = new SqlParameter("DirectionID", SqlDbType.VarChar);
            SqlParameter _Description = new SqlParameter("Description", SqlDbType.VarChar);

            _DirectionID.Value = DO.DirectionID;
            _Description.Value = DO.Description;

            SqlParameter[] _params = new SqlParameter[] {
                _DirectionID,
                _Description
            };

            return DataCommon.ExecuteScalar("[dbo].[Direction_Update]", _params, "dbo");
        }