示例#1
0
        public TaskStatusViewModel GetTaskStatusesForTeam(int teamId)
        {
            TEAM team = _teamRepository.GetTeamById(teamId);
            TaskStatusViewModel taskStatuses = new TaskStatusViewModel();

            if (team != null)
            {
                taskStatuses.TeamId       = team.ID;
                taskStatuses.TaskStatuses = new List <TaskStatusModel>();

                var statuses = GetOrderedTaskStatuses(team);
                if (statuses != null)
                {
                    taskStatuses.TaskStatuses.AddRange(statuses.Select(x => new TaskStatusModel
                    {
                        TeamId         = x.TEAM_ID,
                        StatusId       = x.ID,
                        StatusName     = x.NAME,
                        PrevStatusId   = x.PREV_STATUS_ID,
                        PrevStatusName = x.PREV_STATUS != null ? x.PREV_STATUS.NAME : null,
                        NextStatusId   = x.NEXT_STATUS_ID,
                        NextStatusName = x.NEXT_STATUS != null ? x.NEXT_STATUS.NAME : null
                    }));
                }
                else
                {
                    return(null);
                }
            }

            return(taskStatuses);
        }
示例#2
0
 public IActionResult Status([FromRoute] int taskId, [FromBody] TaskStatusViewModel model)
 {
     _taskService.ChangeStatus(new TaskStatusModel
     {
         Id     = taskId,
         Status = model.Status,
         ModifiedBySystemUserId = model.ModifiedBySystemUserId
     });
     return(Ok(MessageHelper.Success("The task status has been updated successfully.")));
 }
示例#3
0
        async void Delete()
        {
            var response = await dialogService.ShowConfirm(
                "Confirm",
                "Are you sure to delete this Task Status ?");

            if (!response)
            {
                return;
            }

            await TaskStatusViewModel.GetInstance().Delete(this);
        }
        public ToDoStatusPage(Guid?taskId, WorkPercentCompleteType workPercentCompleteType)
        {
            NavigationPage.SetBackButtonTitle(this, "");
            //HockeyApp.MetricsManager.TrackEvent("TaskStatusPage Initialize");
            InitializeComponent();
            Title = "Update Status";

            viewModel = new TaskStatusViewModel();
            viewModel.SelectedTaskId = taskId;



            BindingContext = viewModel;

            GetData(workPercentCompleteType.Id.Value);

            if (Device.RuntimePlatform.ToLower() == "android")
            {
                cmbStatuses.Margin = new Thickness(10, 0, 10, 0);
            }
        }
示例#5
0
        public PartialViewResult Load_Task_Status_View(int taskId, bool?isTaskClosed)
        {
            string visible = "visible";

            if (isTaskClosed == null || isTaskClosed == true)
            {
                visible = "hidden";
            }
            else
            {
                visible = "visible";
            }
            TaskStatusViewModel model = new TaskStatusViewModel();

            model.TaskId           = taskId;
            model.IsTaskClosed     = visible;
            model.RemainedStatuses = db.SP_Select_Remained_Task_Status_ByTaskId(taskId).ToList();
            model.Users            = db.SP_Select_Users().ToList();
            model.Statuses         = db.SP_Select_Task_Status_ByTaskId(taskId).ToList();
            return(PartialView("_Task_Status_View", model));
        }
示例#6
0
 public TaskStatusPage()
 {
     InitializeComponent();
     BindingContext = new TaskStatusViewModel();
 }