/// <summary> /// Them mot binh luan vao co so du lieu /// </summary> /// <param name="binhLuan">Binh luan can them</param> /// <returns>Tra ve <i>true</i> neu binh luan duoc them thanh cong, <i>false</i> neu them that bai</returns> public static bool ThemBinhLuan(BinhLuan binhLuan) { try { db.BinhLuans.AddObject(binhLuan); return db.SaveChanges() > 0; } catch { return false; } }
/// <summary> /// Them tra loi cho mot binh luan /// </summary> /// <param name="maBinhLuan">Ma binh luan duoc tra loi</param> /// <param name="traLoi">Cau tra loi</param> /// <returns>Tra ve <i>true</i> neu tra loi duoc them thanh cong, <i>false</i> neu them that bai</returns> public static bool ThemTraLoi(int maBinhLuan, BinhLuan traLoi) { try { traLoi.MaBinhLuanCha = maBinhLuan; db.BinhLuans.AddObject(traLoi); return db.SaveChanges() > 0; } catch { return false; } }
/// <summary> /// Create a new BinhLuan object. /// </summary> /// <param name="maBinhLuan">Initial value of the MaBinhLuan property.</param> public static BinhLuan CreateBinhLuan(global::System.Int32 maBinhLuan) { BinhLuan binhLuan = new BinhLuan(); binhLuan.MaBinhLuan = maBinhLuan; return binhLuan; }
/// <summary> /// Deprecated Method for adding a new object to the BinhLuans EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToBinhLuans(BinhLuan binhLuan) { base.AddObject("BinhLuans", binhLuan); }