Пример #1
0
        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);
        }
Пример #2
0
        public TaksComentarios ObtenerComentario(int IdTask)
        {
            TaksComentarios item = new TaksComentarios();

            item.IdTaksComentario = 0;
            item.IdTaks           = IdTask;
            return(item);
        }
Пример #3
0
        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);
        }