예제 #1
0
        public ActionResult SaveTask(SprintTask task)
        {
            var    userID = User.Identity.GetUserId();
            string ID;
            var    user = _context.Users.SingleOrDefault(u => u.ApplicationUserId == userID);

            if (task.Id == 0)
            {
                task.DataAdded = DateTime.Now;
                task.Status    = Status.ToDo;
                task.Name      = task.Name;
                task.Note      = task.Note;

                task.UserId = user.Id;


                _context.SprintTasks.Add(task);
            }
            else
            {
                var taskInDb = _context.SprintTasks.Single(s => s.Id == task.Id);
            }


            _context.SaveChanges();
            var sprint = _context.Sprints.SingleOrDefault(m => m.Id == task.SprintId);

            return(RedirectToAction("Index", "ViewModel", new { sprint.ProjectId }));
        }
        public void RemoveTask(SprintTask RemoveTask)
        {
            var task = db.SprintTasks.Where(x => x.Id == RemoveTask.Id).SingleOrDefault();

            db.SprintTasks.Remove(task);
            db.SaveChanges();
        }
예제 #3
0
        public ActionResult NewTask(int sprintID)
        {
            SprintTask task = new SprintTask();

            task.SprintId = sprintID;
            return(View(task));
        }
예제 #4
0
        private void TaskTeamMember_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if ((sender as ComboBox).SelectedIndex != -1)
            {
                SQLiteConnection Connection = new SQLiteConnection("Data Source=" + Environment.CurrentDirectory + Properties.Settings.Default.DBPath);
                Connection.Open();
                DataContext db = new DataContext(Connection);

                // Get a typed table to run queries.
                Table <ScrumTask>  ScrumTsks  = db.GetTable <ScrumTask>();
                Table <SprintTask> SprintTsks = db.GetTable <SprintTask>();

                TeamMember tm = (((sender as ComboBox).SelectedItem as ComboBoxItem).Tag as TeamMember);
                int        SprintTaskID;
                Int32.TryParse(((TaskExternalID.Tag as KanbanCardItem).Content as KanbanModel).ID, out SprintTaskID);

                SprintTask tsk = (from spt in SprintTsks
                                  where spt.ID == SprintTaskID
                                  select spt).SingleOrDefault();
                tsk.TeamMemberID = tm.ID;
                db.SubmitChanges();

                ((TaskExternalID.Tag as KanbanCardItem).Content as KanbanModel).ImageURL = new Uri(@"Images/" + tm.Nickname + ".png", UriKind.RelativeOrAbsolute);

                Kanban.ItemsSource = null;
                Kanban.ItemsSource = (Kanban.DataContext as KanbanDeskViewModel).InventoryView;
            }
        }
예제 #5
0
        public void DeleteSprintTask(SprintTask sprintTask)
        {
            var task = Db.SprintTasks.Where(x => x.Id == sprintTask.Id).SingleOrDefault();

            Db.Remove(task);
            Db.SaveChanges();
        }
예제 #6
0
 public void CreateSprintTask(CreateTaskDto createTaskDto)
 {
     try
     {
         var task = new SprintTask
         {
             Title       = createTaskDto.Title,
             Description = createTaskDto.Description,
             DeveloperId = createTaskDto.DeveloperId,
             SprintId    = createTaskDto.SprintId,
             status      = Status.Pendding
         };
         Db.SprintTasks.Add(task);
         Db.SaveChanges();
         var developers = Db.Developers.Where(x => x.Id == createTaskDto.DeveloperId).SingleOrDefault();
         mail.SendMail(
             developers.Email,
             developers.FirstName,
             "A New Task has been Created <br/>" +
             "Title : " + createTaskDto.Title + "<br/>" +
             "Description : " + createTaskDto.Description + "<br/>" +
             "Best luck PMS bot"
             );
     }
     catch (Exception)
     {
         throw;
     }
 }
        public void CreateSprintTask(CreateTaskDto createTask)
        {
            var task = new SprintTask
            {
                Title       = createTask.Title,
                Description = createTask.Description
            };

            db.SprintTasks.Add(task);
            db.SaveChanges();
        }
예제 #8
0
        public async Task <SprintTask> AddTask(Guid guid, [FromBody] CreateTaskModel model)
        {
            var task = new SprintTask {
                SwimlaneGuid = guid, Title = model.Title, Description = model.Description
            };

            _db.Tasks.Add(task);
            await _db.SaveChangesAsync();

            return(task);
        }
예제 #9
0
        private void Kanban_CardDragEnd(object sender, KanbanDragEndEventArgs e)
        {
            SQLiteConnection Connection = new SQLiteConnection("Data Source=" + Environment.CurrentDirectory + Properties.Settings.Default.DBPath);

            Connection.Open();
            DataContext db = new DataContext(Connection);

            // Get a typed table to run queries.
            Table <SprintTask> SprintTsks = db.GetTable <SprintTask>();

            int SprintTaskID;

            Int32.TryParse((e.SelectedCard.Content as KanbanModel).ID, out SprintTaskID);
            SprintTask tsk = (from sp in SprintTsks
                              where sp.ID == SprintTaskID
                              select sp).SingleOrDefault();

            tsk.State = e.TargetKey.ToString();

            if (e.TargetKey.ToString().Equals("Closed") ||
                e.TargetKey.ToString().Equals("Review"))
            {
                int bp = 0;
                switch (e.TargetKey.ToString())
                {
                case "Review":
                    bp = Convert.ToInt32(Math.Round(tsk.Cost * 0.8));
                    break;

                case "Closed":
                    bp = Convert.ToInt32(Math.Round(tsk.Cost * 0.2));
                    break;
                }
                ;


                Table <SprintBurnData> SprintBrnDt = db.GetTable <SprintBurnData>();
                SprintBurnData         brnDat      = new SprintBurnData
                {
                    SprintID     = 3,
                    BurnDate     = DateTime.Today,
                    BurnPoint    = bp,
                    SprintTaskID = SprintTaskID
                };


                SprintBrnDt.InsertOnSubmit(brnDat);
            }


            db.SubmitChanges();
        }
        //Add A new Task
        public void CreateSprintTask(CreateTaskDto createTask)
        {
            var task = new SprintTask
            {
                Title       = createTask.Title,
                Description = createTask.Description,
                status      = Status.Pendding,
                DeveloperId = createTask.DeveloperId,
                SprintId    = createTask.SprintId
            };

            db.SprintTasks.Add(task);
            db.SaveChanges();
        }
예제 #11
0
        public void InsertSprintTask(SprintTaskDto SprintTaskDto)
        {
            var NewSprintTask = new SprintTask()
            {
                Title       = SprintTaskDto.Title,
                Description = SprintTaskDto.Description,
                SprintId    = SprintTaskDto.SprintId,
                DeveloperId = SprintTaskDto.DeveloperId
            };

            NewSprintTask.StatusSprintTask = (SprintTaskStatus)SprintTaskDto.StatusSprintTaskDto;
            db.SprintTasks.Add(NewSprintTask);
            db.SaveChanges();
        }
예제 #12
0
        public void InsertTask(CreateTaskDto tasktDto)
        {
            SprintTask task = new SprintTask()
            {
                SprintID    = tasktDto.SprintID,
                Title       = tasktDto.Title,
                Description = tasktDto.Description,
                Status      = Status.PendingApproval,
                StartDate   = tasktDto.StartDate,
                EndDate     = tasktDto.EndDate,
                DeveloperID = tasktDto.DeveloperId
            };

            context.SprintTasks.Add(task);
            context.SaveChanges();
        }
예제 #13
0
 public ActionResult Create(SprintTaskAddVM model)
 {
     try
     {
         var newTask = new SprintTask {
             Title = model.Title, Desc = model.Desc
         };
         // TODO: Add insert logic here
         if (ModelState.IsValid)
         {
             _context.Add(newTask);
             _context.SaveChanges();
         }
         return(RedirectToAction(nameof(AgileWall)));
     }
     catch
     {
         return(View());
     }
 }
예제 #14
0
        public ActionResult TaskPage(int taskID)
        {
            SprintTask taskTemp = _context.SprintTasks.SingleOrDefault(t => t.Id == taskID);

            return(View(taskTemp));
        }
예제 #15
0
 public IActionResult Remove(SprintTask removeTask)
 {
     sprintTaskRepository.RemoveTask(removeTask);
     return(Redirect("AllTaskes"));
 }