public void InsertComment(string text,int FK_real,int FK_user) { dbEntities context = new dbEntities(); ComentariiReal Comment = new ComentariiReal(); Comment.TextCampanie = text; Comment.FK_Real = FK_real; Comment.FK_User = FK_user; Comment.Data = DateTime.Now; context.ComentariiReals.AddObject(Comment); // ComentariiReal.CreateComentariiReal(id, text, FK_real, FK_user, DateTime.Now); context.SaveChanges(); }
/// <summary> /// Deprecated Method for adding a new object to the ComentariiReals EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToComentariiReals(ComentariiReal comentariiReal) { base.AddObject("ComentariiReals", comentariiReal); }
/// <summary> /// Create a new ComentariiReal object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="textCampanie">Initial value of the TextCampanie property.</param> /// <param name="fK_Real">Initial value of the FK_Real property.</param> /// <param name="fK_User">Initial value of the FK_User property.</param> /// <param name="data">Initial value of the Data property.</param> public static ComentariiReal CreateComentariiReal(global::System.Int32 id, global::System.String textCampanie, global::System.Int32 fK_Real, global::System.Int32 fK_User, global::System.DateTime data) { ComentariiReal comentariiReal = new ComentariiReal(); comentariiReal.ID = id; comentariiReal.TextCampanie = textCampanie; comentariiReal.FK_Real = fK_Real; comentariiReal.FK_User = fK_User; comentariiReal.Data = data; return comentariiReal; }