Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public bool Create(Reply reply)
        {
            TeamUpContext dbReply = new TeamUpContext();


            dbReply.Replies.Add(reply);
            dbReply.SaveChanges();
            return(true);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        public bool Create(Category category)
        {
            TeamUpContext dbCategory = new TeamUpContext();

            try
            {
                dbCategory.Categories.Add(category);
                dbCategory.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Ejemplo n.º 6
0
        public Category GetOne(string Search)
        {
            TeamUpContext dbCategory = new TeamUpContext();

            return(dbCategory.Categories.FirstOrDefault(x => x.Typology.ToUpper() == Search));
        }
Ejemplo n.º 7
0
        public Category GetOne(int idSearch)
        {
            TeamUpContext dbCategory = new TeamUpContext();

            return(dbCategory.Categories.FirstOrDefault(x => x.CategoryID == idSearch));
        }
Ejemplo n.º 8
0
        public List <Category> GetAll()
        {
            TeamUpContext dbCategory = new TeamUpContext();

            return(dbCategory.Categories.ToList());
        }
Ejemplo n.º 9
0
        public List <Reply> GetAllForTask(int i)
        {
            TeamUpContext dbReply = new TeamUpContext();

            return(dbReply.Replies.Where(x => x.TaskID == i).ToList());
        }