コード例 #1
0
        public void AddTask(ParentTasks TasksModel)
        {
            var TaskDBcontext = new TaskDBEntities();
            var task          = new ParentTask();

            task.Parent_ID   = TasksModel.Parent_ID;
            task.Parent_Task = TasksModel.Parent_Task;
            TaskDBcontext.ParentTasks.Add(task);
            TaskDBcontext.SaveChanges();
        }
コード例 #2
0
        public void Delete(int id)
        {
            var ObjDBcontext = new TaskDBEntities();
            var user         = ObjDBcontext.Users.FirstOrDefault(x => x.User_ID == id);

            if (user != null)
            {
                ObjDBcontext.Users.Remove(user);
                ObjDBcontext.SaveChanges();
            }
        }
コード例 #3
0
        public void Add(Users ObjModel)
        {
            var ObjDBcontext = new TaskDBEntities();
            var Objuser      = new User();

            Objuser.First_Name  = ObjModel.First_Name;
            Objuser.Last_Name   = ObjModel.Last_Name;
            Objuser.Employee_ID = ObjModel.Employee_ID;
            ObjDBcontext.Users.Add(Objuser);
            ObjDBcontext.SaveChanges();
        }
コード例 #4
0
        public void EndTask(int id)
        {
            var TaskDBcontext = new TaskDBEntities();
            var task          = TaskDBcontext.Tasks.FirstOrDefault(x => x.Task_ID == id);

            if (task != null)
            {
                task.IsTaskEnded = 1;
                TaskDBcontext.SaveChanges();
            }
        }
コード例 #5
0
        public void DeleteTask(int id)
        {
            var TaskDBcontext = new TaskDBEntities();
            var task          = TaskDBcontext.ParentTasks.FirstOrDefault(x => x.Parent_ID == id);

            if (task != null)
            {
                TaskDBcontext.ParentTasks.Remove(task);
                TaskDBcontext.SaveChanges();
            }
        }
コード例 #6
0
 public void Delete(int id)
 {
     using (var ObjDBcontext = new TaskDBEntities())
     {
         var model = ObjDBcontext.Projects.FirstOrDefault(x => x.Project_ID == id);
         if (model != null)
         {
             ObjDBcontext.Projects.Remove(model);
             ObjDBcontext.SaveChanges();
         }
     }
 }
コード例 #7
0
 public void AddTask(ParentTasks model)
 {
     using (var TaskDBcontext = new TaskDBEntities())
     {
         var task = new ParentTask();
         task.Parent_ID   = model.Parent_ID;
         task.Parent_Task = model.Parent_Task;
         task.Project_ID  = model.Project_ID;
         TaskDBcontext.ParentTasks.Add(task);
         TaskDBcontext.SaveChanges();
     }
 }
コード例 #8
0
        public void UpdateTask(int id, ParentTasks TasksModel)
        {
            var TaskDBcontext = new TaskDBEntities();
            var task          = TaskDBcontext.ParentTasks.FirstOrDefault(x => x.Parent_ID == id);

            if (task != null)
            {
                task.Parent_ID   = TasksModel.Parent_ID;
                task.Parent_Task = TasksModel.Parent_Task;
                TaskDBcontext.SaveChanges();
            }
        }
コード例 #9
0
        public void Update(int id, Users ObjModel)
        {
            var ObjDBcontext = new TaskDBEntities();
            var user         = ObjDBcontext.Users.FirstOrDefault(x => x.User_ID == id);

            if (user != null)
            {
                user.First_Name  = ObjModel.First_Name;
                user.Last_Name   = ObjModel.Last_Name;
                user.Employee_ID = ObjModel.Employee_ID;
                ObjDBcontext.SaveChanges();
            }
        }
コード例 #10
0
 public void Add(ProjectInfo model)
 {
     using (var ObjDBcontext = new TaskDBEntities())
     {
         var ObjModel = new Project();
         ObjModel.Project1   = model.Project1;
         ObjModel.Start_Date = model.Start_Date;
         ObjModel.End_Date   = model.End_Date;
         ObjModel.End_Date   = model.End_Date;
         ObjModel.Priority   = model.Priority;
         ObjModel.User_ID    = model.User_ID;
         ObjDBcontext.Projects.Add(ObjModel);
         ObjDBcontext.SaveChanges();
     }
 }
コード例 #11
0
        public void AddTask(Tasks TasksModel)
        {
            var TaskDBcontext = new TaskDBEntities();
            var task          = new Task();

            task.Task_ID        = TasksModel.Task_ID;
            task.Task1          = TasksModel.TaskName;
            task.Start_Date     = TasksModel.Start_Date;
            task.End_Date       = TasksModel.End_Date;
            task.Priority       = TasksModel.Priority;
            task.Parent_ID      = TasksModel.Parent_ID;
            task.ParentTaskType = TasksModel.ParentTaskType;
            task.IsTaskEnded    = TasksModel.IsTaskEnded;
            TaskDBcontext.Tasks.Add(task);
            TaskDBcontext.SaveChanges();
        }
コード例 #12
0
 public void Update(int id, ProjectInfo model)
 {
     using (var ObjDBcontext = new TaskDBEntities())
     {
         var ObjModel = ObjDBcontext.Projects.FirstOrDefault(x => x.Project_ID == id);
         if (ObjModel != null)
         {
             ObjModel.Project1   = model.Project1;
             ObjModel.Start_Date = model.Start_Date;
             ObjModel.End_Date   = model.End_Date;
             ObjModel.End_Date   = model.End_Date;
             ObjModel.Priority   = model.Priority;
             ObjModel.User_ID    = model.User_ID;
             ObjDBcontext.SaveChanges();
         }
     }
 }
コード例 #13
0
 public void AddTask(Tasks model)
 {
     using (var TaskDBcontext = new TaskDBEntities())
     {
         var task = new Task();
         task.Task_ID     = model.Task_ID;
         task.Task1       = model.TaskName;
         task.Start_Date  = model.Start_Date;
         task.End_Date    = model.End_Date;
         task.Priority    = model.Priority;
         task.Parent_ID   = model.Parent_ID;
         task.IsTaskEnded = model.IsTaskEnded;
         task.Project_ID  = model.Project_ID;
         TaskDBcontext.Tasks.Add(task);
         TaskDBcontext.SaveChanges();
     }
 }
コード例 #14
0
        public void UpdateTask(int id, Tasks TasksModel)
        {
            var TaskDBcontext = new TaskDBEntities();
            var task          = TaskDBcontext.Tasks.FirstOrDefault(x => x.Task_ID == id);

            if (task != null)
            {
                task.Task_ID        = TasksModel.Task_ID;
                task.Task1          = TasksModel.TaskName;
                task.Start_Date     = TasksModel.Start_Date;
                task.End_Date       = TasksModel.End_Date;
                task.Priority       = TasksModel.Priority;
                task.Parent_ID      = TasksModel.Parent_ID;
                task.ParentTaskType = TasksModel.ParentTaskType;
                task.IsTaskEnded    = TasksModel.IsTaskEnded;
                TaskDBcontext.SaveChanges();
            }
        }