示例#1
0
 private void HandleTouchUpInsideSave(object sender, EventArgs ea)
 {
     if (textboxTotal.Text == null || textboxTotal.Text == "")
     {
         record.Answer = "0";
     }
     else
     {
         record.Answer = textboxTotal.Text;
     }
     record.CreatedAt  = DateTime.Now.Date;
     record.ModifiedAt = DateTime.Now.Date;
     repository.Update(record);
     if (Id == 6)
     {
         UIStoryboard storyboard = UIStoryboard.FromName("Main", null);
         var          controller = (OverviewController)storyboard.InstantiateViewController("OverviewController");
         this.PresentViewController(controller, true, null);
     }
     else
     {
         UIStoryboard storyboard = UIStoryboard.FromName("Main", null);
         var          controller = (OtherQuestionController)storyboard.InstantiateViewController("OtherQuestionController");
         controller.Id = Id + 1;
         this.PresentViewController(controller, true, null);
     }
 }
        //TODO actuated by button click
        private async void HandleButtonClear(object sender, EventArgs ea)
        {
            int button = await ShowAlert("Clear", "Are you sure you want to restart your profile?", "Yes", "Cancel");

            if (button == 0)
            {
                for (int i = 1; i < 7; i++)
                {
                    GetQuestion(i);
                    record.Answer = "";
                    repository.Update(record);
                }
                Transition(1);
            }
        }
示例#3
0
        private void HandleTouchUpInsideSave(object sender, EventArgs ea)
        {
            record.Answer = DateTime.Parse(dateBirthday.Date.ToString()).ToShortDateString();
            repository.Update(record);
            UIStoryboard storyboard = UIStoryboard.FromName("Main", null);
            var          controller = (OtherQuestionController)storyboard.InstantiateViewController("OtherQuestionController");

            for (int i = 2; i < 7; i++)
            {
                record = repository.Get(i);
                if (record.Answer == null || record.Answer == "")
                {
                    controller.Id = i;
                    this.PresentViewController(controller, true, null);
                    break;
                }
                if (i == 7)
                {
                    controller.Id = 7;
                    this.PresentViewController(controller, true, null);
                    break;
                }
            }
        }