/// <summary> /// Xóa mẫu tin hỏi đáp /// </summary> /// <param name="o"></param> public static void Delete(FAQs o) { DBHelp db = new DBHelp(); db.AddParameter("@FAQID", o.FAQID); db.ExecuteNonQuery("sp_FAQ_Delete", CommandType.StoredProcedure); }
/// <summary> /// Thêm mới mẫu tin hỏi đáp /// </summary> /// <param name="o"></param> public static void Insert(FAQs o) { DBHelp db = new DBHelp(); db.AddParameter("@Title", o.Title); db.AddParameter("@Description", o.Description); db.AddParameter("@CreateDate", DateTime.Now.ToShortDateString()); db.AddParameter("@CreateUser", o.CreateUser); db.ExecuteNonQuery("sp_FAQ_Insert", CommandType.StoredProcedure); }
/// <summary> /// Cập nhật mẫu tin hỏi đáp /// </summary> /// <param name="o"></param> public static void Update(FAQs o) { DBHelp db = new DBHelp(); db.AddParameter("@FAQID", o.FAQID); db.AddParameter("@Title", o.Title); db.AddParameter("@Description", o.Description); db.AddParameter("@EditDate", DateTime.Now.ToShortDateString()); db.AddParameter("@EditUser", o.EditUser); db.ExecuteNonQuery("sp_FAQ_Update", CommandType.StoredProcedure); }
/// <summary> /// Truy xuất toàn bộ bảng hỏi đáp /// </summary> /// <param name="o"></param> /// <returns></returns> public static FAQs GetByID(FAQs o) { FAQs obj = new FAQs(); DBHelp db = new DBHelp(); db.AddParameter("@FAQID", o.FAQID); SqlDataReader reader = db.ExecuteReader("sp_FAQ_Select", CommandType.StoredProcedure); if (reader.Read()) { obj = new FAQs(reader); } reader.Close(); return(obj); }