//Delete a task in the db
 public static void DeleteTask(int taskId)
 {
     RoleClaimContext db = new RoleClaimContext();
     Task task = db.Tasks.Find(taskId);
     db.Tasks.Remove(task);
     db.SaveChanges();
 }
 //Update an existing task in the db.
 public static void UpdateTask(int taskId, string status)
 {
     RoleClaimContext db = new RoleClaimContext();
     Task task = db.Tasks.Find(taskId);
     task.Status = status;
     db.SaveChanges();
 }
Ejemplo n.º 3
0
        //Delete a task in the db
        public static void DeleteTask(int taskId)
        {
            RoleClaimContext db   = new RoleClaimContext();
            Task             task = db.Tasks.Find(taskId);

            db.Tasks.Remove(task);
            db.SaveChanges();
        }
Ejemplo n.º 4
0
        //Update an existing task in the db.
        public static void UpdateTask(int taskId, string status)
        {
            RoleClaimContext db   = new RoleClaimContext();
            Task             task = db.Tasks.Find(taskId);

            task.Status = status;
            db.SaveChanges();
        }
 // Add a task to the db.
 public static void AddTask(string taskText)
 {
     RoleClaimContext db = new RoleClaimContext();
     Task newTask = new Task
     {
         Status = "NotStarted",
         TaskText = taskText
     };
     db.Tasks.Add(newTask);
     db.SaveChanges();
 }
Ejemplo n.º 6
0
        // Add a task to the db.
        public static void AddTask(string taskText)
        {
            RoleClaimContext db      = new RoleClaimContext();
            Task             newTask = new Task
            {
                Status   = "NotStarted",
                TaskText = taskText
            };

            db.Tasks.Add(newTask);
            db.SaveChanges();
        }