public int InsertComment(TaksComentarios comment) { int val = 0; try { using (ClusmextContext context = new ClusmextContext()) { if (comment.IdTaksComentario > 0) { context.Entry(comment).State = EntityState.Modified; } else { context.Entry(comment).State = EntityState.Added; } val = context.SaveChanges(); } } catch (Exception ex) { } return(val); }
public TaksComentarios ObtenerComentario(int IdTask) { TaksComentarios item = new TaksComentarios(); item.IdTaksComentario = 0; item.IdTaks = IdTask; return(item); }
public TaksComentarios GetComment(int id) { TaksComentarios c = new TaksComentarios(); try { using (ClusmextContext context = new ClusmextContext()) { c = context.TaksComentarios.Include("TaksAdmon").Where(x => x.IdTaksComentario == id).SingleOrDefault(); } } catch (Exception ex) { } return(c); }