Exemplo n.º 1
0
        private void RegisterTask(object sender, EventArgs args)
        {
            if (TxtName.Text.Trim().Length > 0 && this.Prioritie > 0)
            {
                TaskController _tskList = new TaskController();


                Modelos.Priorities _prioritie = new Priorities();
                _prioritie.IndexPrioritie = this.Prioritie;
                _prioritie.NamePrioritie  = Priorities.PrioritieSelected(this.Prioritie);

                Modelos.Task _task = new Modelos.Task();
                _task.DateDone  = null;
                _task.Index     = _tskList.SizeListTask(); /*take the last saved task add one and...*/
                _task.TaskName  = TxtName.Text.Trim();
                _task.Prioritie = _prioritie;              /*update critic task image*/

                new TaskController().Save(_task);

                App.Current.MainPage = new NavigationPage(new Index());
            }
            else
            {
                DisplayAlert("ERROR", "Please, infomr the name of the task as also a prioritie!", "Gotcha!");
            }
        }