Exemple #1
0
 public void Activate(int id)
 {
     using (var context = new IdeaPoolEntities())
     {
         IdeaStatus status = Get(context, id);
         status.IsActive = true;
         Update(context, status);
     }
 }
Exemple #2
0
        public bool UpdateStatus(int ideaId, int statusId, int userId)
        {
            bool isUpdate = false;

            using (var context = new IdeaPoolEntities())
            {
                Idea       idea   = context.Ideas.SingleOrDefault(x => x.Id == ideaId);
                IdeaStatus status = context.IdeaStatus.SingleOrDefault(x => x.Id == statusId);
                if (idea != null && status != null)
                {
                    idea.IdeaStatus           = status;
                    context.Entry(idea).State = EntityState.Modified;
                    InsertIdeaHistory(context, ideaId, userId, ActivityKeys.UPDATE_IDEA_STATUS, status.Status);
                    context.SaveChanges();
                    isUpdate = true;
                }
            }
            return(isUpdate);
        }
Exemple #3
0
 private void Update(IdeaPoolEntities context, IdeaStatus status)
 {
     context.Entry(status).State = System.Data.Entity.EntityState.Modified;
     context.SaveChanges();
 }