Exemple #1
0
        public int Edit(TaskDO model)
        {
            var editData = dbContext.tblTasks.First(x => x.TaskId == model.TaskId);

            editData.EndDate      = model.EndDate;
            editData.IsParentTask = model.IsParentTask;
            editData.ParentTask   = model.ParentTask;
            editData.Priority     = model.Priority;
            editData.ProjectID    = model.ProjectID;
            editData.StartDate    = model.StartDate;
            editData.Status       = model.Status;
            editData.Task         = model.Task;
            editData.TaskId       = model.TaskId;
            editData.TaskOwner    = model.TaskOwner;
            return(dbContext.SaveChanges());
        }
Exemple #2
0
        public int Add(TaskDO model)
        {
            var data = dbContext.tblTasks.Add(new tblTask()
            {
                EndDate      = model.EndDate,
                IsParentTask = model.IsParentTask,
                ParentTask   = model.ParentTask,
                Priority     = model.Priority,
                ProjectID    = model.ProjectID,
                StartDate    = model.StartDate,
                Status       = model.Status,
                Task         = model.Task,
                TaskId       = model.TaskId,
                TaskOwner    = model.TaskOwner
            });

            return(dbContext.SaveChanges());
        }
Exemple #3
0
        public TaskDO GetById(int id)
        {
            var model = dbContext.tblTasks.FirstOrDefault(x => x.TaskId == id);
            var task  = new TaskDO()
            {
                EndDate      = model.EndDate,
                IsParentTask = model.IsParentTask,
                ParentTask   = model.ParentTask,
                Priority     = model.Priority,
                ProjectID    = model.ProjectID,
                StartDate    = model.StartDate,
                Status       = model.Status,
                Task         = model.Task,
                TaskId       = model.TaskId,
                TaskOwner    = model.TaskOwner
            };

            return(task);
        }