Exemplo n.º 1
0
        /// <summary>
        /// Xóa đối tác
        /// </summary>
        /// <param name="o"></param>
        public static void Delete(Partners o)
        {
            DBHelp db = new DBHelp();

            db.AddParameter("@PartnerID", o.PartnerID);
            db.ExecuteNonQuery("sp_Partner_Delete", CommandType.StoredProcedure);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Thêm mới đối tác
        /// </summary>
        /// <param name="o"></param>
        public static void Insert(Partners o)
        {
            DBHelp db = new DBHelp();

            db.AddParameter("@Name", o.PartnerName);
            db.AddParameter("@ImageURL", o.ImageURL);
            db.AddParameter("@Description", o.Description);
            db.AddParameter("@Website", o.Website);
            db.AddParameter("@Email", o.Email);
            db.AddParameter("@CreateDate", DateTime.Now.ToShortDateString());
            db.AddParameter("@CreateUser", o.CreateUser);
            db.ExecuteNonQuery("sp_Partner_Insert", CommandType.StoredProcedure);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Truy xuất toàn bộ bảng đối tác
        /// </summary>
        /// <returns></returns>
        public static Partners GetByID(Partners o)
        {
            Partners obj = new Partners();
            DBHelp   db  = new DBHelp();

            db.AddParameter("@PartnerID", o.PartnerID);

            SqlDataReader reader = db.ExecuteReader("sp_Partner_Select", CommandType.StoredProcedure);

            if (reader.Read())
            {
                obj = new Partners(reader);
            }
            reader.Close();
            return(obj);
        }