Пример #1
0
        private void ListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            TaskObject current = new TaskObject();

            current = (TaskObject)e.ClickedItem;
            ChangeCurrentTask(current);
            Frame.Navigate(typeof(TaskPage));
        }
Пример #2
0
        public TaskObject CopyData()
        {
            TaskObject var = (TaskObject)this.MemberwiseClone();

            var.TaskName      = TaskName;
            var.Description   = Description;
            var.Deadline      = Deadline;
            var.AdditionDate  = AdditionDate;
            var.UserPriority  = UserPriority;
            var.EstimatedTime = EstimatedTime;
            var.Sessions      = Sessions;
            var.TruePriority  = TruePriority;
            var.StartDate     = StartDate;
            var.EndDate       = EndDate;

            return(var);
        }
Пример #3
0
        public bool AddANewTask()
        {
            TaskObject VAR = new TaskObject();
            double     aux1, aux2;

            if (string.IsNullOrWhiteSpace(TextBoxTitle.Text))
            {
                ErrorMessage("Error. Title empty.");
                return(false);
            }
            VAR.ChangeName(TextBoxTitle.Text);
            VAR.ChangeDescription(TextBoxDescription.Text);
            VAR.UserPriority = newpriorityslider.Value;
            double.TryParse(TextBoxHours.Text, out aux1);
            double.TryParse(TextBoxMinutes.Text, out aux2);
            if ((string.IsNullOrWhiteSpace(TextBoxHours.Text) || string.IsNullOrWhiteSpace(TextBoxMinutes.Text)) && aux2 > 59)
            {
                ErrorMessage("Error. Estimated time incorrectly set.");
                return(false);
            }
            VAR.EstimatedTime = aux1 + aux2 / 60;
            VAR.AdditionDate  = DateTime.Now;
            if (DeadlinePicker.Date.LocalDateTime < VAR.AdditionDate)
            {
                ErrorMessage("Error. Deadline impossible.");
                return(false);
            }
            VAR.Deadline = new DateTime();
            VAR.Deadline = DeadlinePicker.Date.LocalDateTime;
            //TO CALCULATE THE EXTRA PARAM - HELDUP HOURS

            VAR.CalculateTruePriority(0);

            Globals.TaskList.Add(VAR);
            //UtilityClass.DataToText();

            CalculatorClass.ScheduleCalculate();

            return(true);
        }
Пример #4
0
 public void ChangeCurrentTask(TaskObject parameter)
 {
     Globals.CurrentTask = parameter;
 }