Example #1
0
        public async Task <object> AddLabelToTask([FromRoute] string taskId, [FromBody] string labelId)
        {
            using (var ctx = new AckeeCtx())
            {
                var task = await ctx.Tasks.FirstOrDefaultAsync(t => t.TaskID == taskId);

                var label = await ctx.Labels.FirstOrDefaultAsync(l => l.LabelID == labelId);

                var existingTaskLabel = await ctx.TaskLabels.FirstOrDefaultAsync(tl => tl.TaskID == taskId && tl.LabelID == labelId);

                if (task == null || existingTaskLabel != null)
                {
                    return(BadRequest());
                }

                // Create the task label
                TaskLabel taskLabel = new TaskLabel
                {
                    Task  = task,
                    Label = label
                };

                ctx.TaskLabels.Add(taskLabel);
                await ctx.SaveChangesAsync();

                return(true);
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (ContinueButton != null)
            {
                ContinueButton.Dispose();
                ContinueButton = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (ProjectLabel != null)
            {
                ProjectLabel.Dispose();
                ProjectLabel = null;
            }

            if (TaskLabel != null)
            {
                TaskLabel.Dispose();
                TaskLabel = null;
            }

            if (TimeLabel != null)
            {
                TimeLabel.Dispose();
                TimeLabel = null;
            }
        }
Example #3
0
 public TaskRecord(int Id, string Caption, string Description, int Status, int Label)
 {
     this.Id          = Id;
     this.Caption     = Caption;
     this.Description = Description;
     this.Status      = (TaskStatus)Status;
     this.Label       = (TaskLabel)Label;
 }
Example #4
0
        public SuccessResponse <TaskLabelDto> AddTaskLabel([FromBody] TaskLabelDto labelDto, Guid id)
        {
            var model = new TaskLabel {
                TaskId = id, LabelId = Guid.Parse(labelDto.LabelId)
            };
            var res = _taskService.AddTaskLabel(model);

            return(new SuccessResponse <TaskLabelDto>(_mapper.Map <TaskLabelDto>(res)));
        }
Example #5
0
 // Start is called before the first frame update
 void Start()
 {
     GameObject.FindObjectOfType <TaskManager>().AddWorkOrder(this);
     if (AppManage.Instance.isInGame)
     {
         SetTasks();
         TaskLabel label = taskList.transform.GetChild(index).gameObject.GetComponent <TaskLabel>();
         label.clickCallBack.Invoke(label.task);
         // ReadNodes(AppManage.Instance.saveData.tecStates);
     }
 }
Example #6
0
        Color GetLabelColor(TaskLabel label)
        {
            switch (label)
            {
            case TaskLabel.Red: return(ColorTranslator.FromHtml("#f06562"));

            case TaskLabel.Green: return(ColorTranslator.FromHtml("#069c47"));

            case TaskLabel.Yellow: return(ColorTranslator.FromHtml("#e6c730"));

            default: return(Color.Empty);
            }
        }
Example #7
0
        void ReleaseDesignerOutlets()
        {
            if (ContinueButton != null)
            {
                ContinueButton.Dispose();
                ContinueButton = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (DescriptionTopDistanceConstraint != null)
            {
                DescriptionTopDistanceConstraint.Dispose();
                DescriptionTopDistanceConstraint = null;
            }

            if (ProjectDotView != null)
            {
                ProjectDotView.Dispose();
                ProjectDotView = null;
            }

            if (ProjectLabel != null)
            {
                ProjectLabel.Dispose();
                ProjectLabel = null;
            }

            if (TaskLabel != null)
            {
                TaskLabel.Dispose();
                TaskLabel = null;
            }

            if (TimeLabel != null)
            {
                TimeLabel.Dispose();
                TimeLabel = null;
            }
        }
Example #8
0
 public void Dispose()
 {
     TaskLabel.Dispose();
     TaskProgressBar.Dispose();
     TaskButton.Dispose();
 }
Example #9
0
 public TaskLabel AddTaskLabel(TaskLabel model)
 {
     _unitOfWork.Repository <TaskLabel>().Add(model);
     _unitOfWork.Complete();
     return(model);
 }