public List <Category> getAllForProject(int id) { TeamUpContext dbCategory = new TeamUpContext(); var competence = dbCategory.Categories.SqlQuery("SELECT cm.* FROM [CategoryProjects] pc INNER JOIN [Categories] cm on pc.[Category_CategoryID] = cm.[CategoryID] where [Project_ProjectID]= " + id).ToList(); return(competence); }
public bool Delete(int category) { TeamUpContext dbCategory = new TeamUpContext(); dbCategory.Database.ExecuteSqlCommand("delete from [Categories] where [CategoryID] =" + category); dbCategory.Database.ExecuteSqlCommand("Delete from [CategoryProjects] where [Category_CategoryID] = " + category); dbCategory.SaveChanges(); return(true); }
public bool Create(Reply reply) { TeamUpContext dbReply = new TeamUpContext(); dbReply.Replies.Add(reply); dbReply.SaveChanges(); return(true); }
public string GetOne(string idSearch) { var configValue = ""; TeamUpContext dbConfig = new TeamUpContext(); configValue = dbConfig.Database.SqlQuery <string>("SELECT TOP (1) [value] FROM [ConfigSystem] where nome ='" + idSearch + "'").FirstOrDefault(); return(configValue); }
public bool Create(Category category) { TeamUpContext dbCategory = new TeamUpContext(); try { dbCategory.Categories.Add(category); dbCategory.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public Category GetOne(string Search) { TeamUpContext dbCategory = new TeamUpContext(); return(dbCategory.Categories.FirstOrDefault(x => x.Typology.ToUpper() == Search)); }
public Category GetOne(int idSearch) { TeamUpContext dbCategory = new TeamUpContext(); return(dbCategory.Categories.FirstOrDefault(x => x.CategoryID == idSearch)); }
public List <Category> GetAll() { TeamUpContext dbCategory = new TeamUpContext(); return(dbCategory.Categories.ToList()); }
public List <Reply> GetAllForTask(int i) { TeamUpContext dbReply = new TeamUpContext(); return(dbReply.Replies.Where(x => x.TaskID == i).ToList()); }