Пример #1
0
        /// <summary>
        /// caraga de vista de sintomas al igual que carga controles como la fecha descripción y emoción.
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            fechaSintomaEmocionalDatePicker.TimeZone = NSTimeZone.LocalTimeZone;

            FullProperties properties = new FullProperties();

            properties.Fecha = DateTime.SpecifyKind((DateTime)fechaSintomaEmocionalDatePicker.Date, DateTimeKind.Utc).ToLocalTime().ToShortDateString();

            fechaSintomaEmocionalDatePicker.ValueChanged += FechaSintomaFisicoDatePicker_ValueChanged;
        }
Пример #2
0
        /// <summary>
        /// Guarda el estado del botón precionado en este caso el sisntoma
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        private void GuardarSintomaFisicoButton_TouchUpInside(object sender, EventArgs e)
        {
            if (!(intensidad == 0 || intensidad > 6) && !fechaSintomaFisicoButton.TitleLabel.Text.Equals("Seleccione la fecha") && !descripcionSintomaFisicoTextField.Text.Equals(""))
            {
                iOSConnection iOSConnection = new iOSConnection();
                var           connection    = iOSConnection.DBiOSConnection();
                DBConnection  dbConnection  = new DBConnection(connection);

                FullProperties property = new FullProperties();

                SintomasFisicos sintomaFisico = new SintomasFisicos()
                {
                    Descripcion = descripcionSintomaFisicoTextField.Text,
                    Intensidad  = Dolor,
                    Fecha       = fechaSintomaFisicoButton.TitleLabel.Text,
                    ídSintoma   = property.IdSintoma
                };

                dbConnection.CreateSintomaFisico(sintomaFisico);

                SintomasFisicosTableViewController detailUnidad = this.Storyboard.InstantiateViewController("sintomasFisicosTable") as SintomasFisicosTableViewController;
                if (detailUnidad != null)
                {
                    this.NavigationController.ShowViewController(detailUnidad, this);
                }
            }
            else
            {
                string mensaje = "";

                if (intensidad == 0 || intensidad > 6)
                {
                    mensaje = mensaje + "\nSeleccione la intensidad del dolor";
                }
                if (fechaSintomaFisicoButton.TitleLabel.Text.Equals("Seleccione la fecha"))
                {
                    mensaje = mensaje + "\nSeleccione la fecha";
                }
                if (descripcionSintomaFisicoTextField.Text.Equals(""))
                {
                    mensaje = mensaje + "\nAgrega una descripción";
                }

                Messages(mensaje);
            }
        }
Пример #3
0
        public override void ViewWillAppear(bool animated)
        {
            iOSConnection iOSConnection = new iOSConnection();
            var           connection    = iOSConnection.DBiOSConnection();
            DBConnection  dbConnection  = new DBConnection(connection);

            FullProperties property = new FullProperties();

            List <SintomasFisicos> list = dbConnection.GetAllSintomasFisicos(property.IdSintoma);

            SintomasFisicosTableView.Source = new SintomasFisicosTableSource(list);

            SintomasFisicosTableView.RowHeight          = UITableView.AutomaticDimension;
            SintomasFisicosTableView.EstimatedRowHeight = 40f;

            SintomasFisicosTableView.ReloadData();
        }
Пример #4
0
        /// <summary>
        /// Guarda los datos emocionales dados por el usario
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        private void GuardarSintomaEmocionalButton_TouchUpInside(object sender, EventArgs e)
        {
            if (!(intensidad == 0 || intensidad > 6) && !fechaSintomaEmocionalButton.TitleLabel.Text.Equals("Seleccione la fecha"))
            {
                iOSConnection iOSConnection = new iOSConnection();
                var           connection    = iOSConnection.DBiOSConnection();
                DBConnection  dbConnection  = new DBConnection(connection);

                FullProperties property = new FullProperties();

                SintomasEmocionales sintomaEmocional = new SintomasEmocionales()
                {
                    Tipo      = Emocional,
                    Fecha     = fechaSintomaEmocionalButton.TitleLabel.Text,
                    ídSintoma = property.IdSintoma
                };

                dbConnection.CreateSintomaEmocional(sintomaEmocional);

                SintomasEmocionalesTableViewController detailUnidad = this.Storyboard.InstantiateViewController("sintomasEmocionalesTable") as SintomasEmocionalesTableViewController;
                if (detailUnidad != null)
                {
                    this.NavigationController.ShowViewController(detailUnidad, this);
                }
            }
            else
            {
                string mensaje = "";
                if (intensidad == 0 || intensidad > 6)
                {
                    mensaje = mensaje + "\nSeleccione la emoción que esta experimentando";
                }
                if (fechaSintomaEmocionalButton.TitleLabel.Text.Equals("Seleccione la fecha"))
                {
                    mensaje = mensaje + "\nSeleccione la fecha";
                }

                Messages(mensaje);
            }
        }
Пример #5
0
        public void UnwindToSintomaEmocionalViewController(UIStoryboardSegue segue)
        {
            FullProperties properties = new FullProperties();

            fechaSintomaEmocionalButton.SetTitle(properties.Fecha, UIControlState.Normal);
        }
Пример #6
0
        /// <summary>
        /// Control para el cambio de fecha
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        private void FechaSintomaFisicoDatePicker_ValueChanged(object sender, EventArgs e)
        {
            FullProperties properties = new FullProperties();

            properties.Fecha = DateTime.SpecifyKind((DateTime)(sender as UIDatePicker).Date, DateTimeKind.Utc).ToLocalTime().ToShortDateString();
        }