Ejemplo n.º 1
0
        private void SetColor(TaskStateBaseNames taskStateNames)
        {
            switch (taskStateNames)
            {
            case TaskStateBaseNames.ToDo:
                bar.BackColor     = Color.Red;
                firstInitial      = true;
                rdBtnTodo.Checked = true;
                break;

            case TaskStateBaseNames.Doing:
                bar.BackColor      = Color.Yellow;
                firstInitial       = true;
                rdBtnDoing.Checked = true;
                break;

            case TaskStateBaseNames.Done:
                bar.BackColor     = Color.LawnGreen;
                firstInitial      = true;
                rdBtnDone.Checked = true;
                break;

            case TaskStateBaseNames.Default:
                bar.BackColor = Color.MediumPurple;
                break;

            default:
                bar.BackColor = Color.MediumPurple;
                break;
            }
        }
Ejemplo n.º 2
0
        protected virtual void OnChangeState(object sender, System.EventArgs e)
        {
            if (!firstInitial)
            {
                var selected = (MetroRadioButton)sender;
                var isInvoke = false;
                if (selected.Text == "To Do" && selected.Checked)
                {
                    _taskStateNames = TaskStateBaseNames.ToDo;
                    isInvoke        = true;
                }
                else if (selected.Text == "Doing" && selected.Checked)
                {
                    _taskStateNames = TaskStateBaseNames.Doing;
                    isInvoke        = true;
                }
                else if (selected.Text == "Done" && selected.Checked)
                {
                    _taskStateNames = TaskStateBaseNames.Done;
                    isInvoke        = true;
                }

                if (isInvoke)
                {
                    ChangeState?.Invoke(_taskStateNames, new ChangeStateEventArgs(TaskId));
                }
            }
            else
            {
                firstInitial = false;
            }
        }
Ejemplo n.º 3
0
        public IResult UpdateState(int argsTaskId, TaskStateBaseNames selected)
        {
            var result = GetById(argsTaskId).Data;

            result.TaskStateId = (int)selected;
            result.TaskState   = new TaskState()
            {
                Id = (int)selected
            };
            return(Update(result));
        }
Ejemplo n.º 4
0
 public TaskCreate()
 {
     _taskService     = DI.GetService <ITaskService>();
     _businessHelper  = DI.GetService <IBusinessHelper>();
     _employeeService = DI.GetService <IEmployeeService>();
     InitializeComponent();
     createTask        = new Entities.Task();
     _taskStateNames   = TaskStateBaseNames.ToDo;
     selectedEmployees = new List <Employee>();
     LoadData();
     this.Closed      += OnClosed;
     estDateTime.Value = _businessHelper.AvgTaskEstimated(Session.CurrentProject.Id);
 }
Ejemplo n.º 5
0
        void SetState(TaskStateBaseNames taskStateNames)
        {
            switch (taskStateNames)
            {
            case TaskStateBaseNames.ToDo:
                rdBtnTodo.Checked = true;
                break;

            case TaskStateBaseNames.Doing:
                rdBtnDoing.Checked = true;
                break;

            case TaskStateBaseNames.Done:
                rdBtnDone.Checked = true;
                break;
            }
        }
Ejemplo n.º 6
0
        protected virtual void OnChangeState(object sender, System.EventArgs e)
        {
            var selected = (MetroRadioButton)sender;

            if (selected.Text == "To do" && selected.Checked)
            {
                _taskStateNames = TaskStateBaseNames.ToDo;
            }
            else if (selected.Text == "Doing" && selected.Checked)
            {
                _taskStateNames = TaskStateBaseNames.Doing;
            }
            else if (selected.Text == "Done" && selected.Checked)
            {
                _taskStateNames = TaskStateBaseNames.Done;
            }
        }