public int InsertGrCateIdea(CategoryGroupIdea model) { model.CreatedDate = DateTime.Now; db.CategoryGroupIdeas.Add(model); db.SaveChanges(); return(model.CategoryGroupIdeaID); }
public bool InsertIdeaCategory(IdeaCategory model) { try { model.IdeaCateViewC = 0; model.CreatedDate = DateTime.Now; model.ModifiedDate = DateTime.Now; model.FinalCloseDate = DateTime.Now.AddDays(90); db.IdeaCategories.Add(model); db.SaveChanges(); return(true); } catch (Exception) { throw; } }
//InsertViewCount public bool InsertViewCount(int ideaId) { try { var rs = db.Ideas.SingleOrDefault(x => x.IdeaID == ideaId); rs.IdeaViewCount += 1; db.SaveChanges(); return(true); } catch (Exception) { throw; } }