Esempio n. 1
0
        /// <summary>
        /// Shows Date picker for end Date time
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Txt_end_date_val_Click(object sender, EventArgs e)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime date)
            {
                try
                {
                    if (date.Date < startDateTime.Date)
                    {
                        UtilityDroid.GetInstance().ShowAlertDialog(mActivity,
                                                                   Resources.GetString(Resource.String.error_alert_title),
                                                                   Resources.GetString(Resource.String.alert_message_not_less_than_from_date),
                                                                   Resources.GetString(Resource.String.alert_cancel_btn),
                                                                   Resources.GetString(Resource.String.alert_ok_btn));
                    }
                    else
                    {
                        endDateTime           = date;
                        txt_end_date_val.Text = Utils.Utilities.DateIntoWebserviceFormat(date);
                    }
                }
                catch (Exception ex)
                {
                }
            }, endDateTime);

            frag.Show(SupportFragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 2
0
        public void ShowDatePickerDialog(FragmentManager fragmentManager)
        {
            var newFragment = new DatePickerFragment();

            newFragment.mParent = this;
            newFragment.Show(fragmentManager, "datePicker");
        }
        private void Edt_to_date_Click(object sender, EventArgs e)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                try
                {
                    if (time.Date < fromDateTime.Date)
                    {
                        UtilityDroid.GetInstance().ShowAlertDialog(mActivity,
                                                                   Resources.GetString(Resource.String.error_alert_title),
                                                                   Resources.GetString(Resource.String.alert_message_not_less_than_from_date),
                                                                   Resources.GetString(Resource.String.alert_cancel_btn),
                                                                   Resources.GetString(Resource.String.alert_ok_btn));
                    }
                    else
                    {
                        toDateTime       = time;
                        string toDate    = Utils.Utilities.DateIntoWebserviceFormat(time);
                        txt_to_date.Text = toDate;
                    }
                }
                catch (Exception ex)
                {
                }
            }, toDateTime);

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 4
0
        void InitHandlers()
        {
            var genders = new List <string>();

            Enum.GetNames(typeof(Gender)).ToList().ForEach(c => genders.Add(c.ToEnumString()));
            SpinnerGender.Adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, genders);
            DatePickerFragment frag = new DatePickerFragment(TextDateOfBirth, SupportFragmentManager)
            {
                MinDate = DateTime.Now.AddYears(-100),
                MaxDate = DateTime.Now,
            };

            frag.DateSelected += (s, d) => { CurMember.DateOfBirth = d; DOB = d; };

            TextFirstName.TextChanged   += (o, e) => TILFirstName.Error = null;
            TextLastName.TextChanged    += (o, e) => TILSurname.Error = null;
            TextDateOfBirth.TextChanged += (o, e) => TILDOB.Error = null;
            TextMobile.TextChanged      += (o, e) => TILMobile.Error = null;
            TextEmail.TextChanged       += (o, e) => TILEmail.Error = null;
            TextNationalID.TextChanged  += (o, e) => TILNationalID.Error = null;
            TextProvince.TextChanged    += (o, e) => TILProvince.Error = null;
            TextDistrict.TextChanged    += (o, e) => TILDistrict.Error = null;
            TextECnumber.TextChanged    += (o, e) => TILECnumber.Error = null;

            var cities    = SessionManager.Cities();
            var locations = SessionManager.Locations();
            var provinces = SessionManager.Provinces();
            var districts = SessionManager.Districts();

            TextProvince.Adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleExpandableListItem1, provinces);
            TextDistrict.Adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleExpandableListItem1, districts);
        }
    public static DatePickerFragment NewInstance(Action <DateTime> onDateSelected)
    {
        DatePickerFragment frag = new DatePickerFragment();

        frag._dateSelectedHandler = onDateSelected;
        return(frag);
    }
Esempio n. 6
0
        /// <summary>
        /// Shows Date picker for start Date time
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Txt_order_date_val_Click(object sender, EventArgs e)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime date)
            {
                try
                {
                    //if (date.Date < DateTime.Now.Date)
                    //{
                    //    UtilityDroid.GetInstance().ShowAlertDialog(mActivity,
                    //        Resources.GetString(Resource.String.error_alert_title),
                    //        Resources.GetString(Resource.String.alert_message_not_less_than_current_date),
                    //        Resources.GetString(Resource.String.alert_cancel_btn),
                    //        Resources.GetString(Resource.String.alert_ok_btn));
                    //}
                    //else
                    //{
                    orderDateTime           = date;
                    txt_order_date_val.Text = Utils.Utilities.DateIntoWebserviceFormat(date);
                    //  }
                }
                catch (Exception ex)
                {
                }
            }, orderDateTime);

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.MedicamentoAdd);

            Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            // Una marca atrás en el icono en ActionBar
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            _edtFarmaco = FindViewById <EditText>(Resource.Id.editFarmaco); // Farmaco
            _edtDosis   = FindViewById <EditText>(Resource.Id.editDosis);   // Dosis
            _radio1     = FindViewById <RadioButton>(Resource.Id.radio1);   // Oral
            _radio2     = FindViewById <RadioButton>(Resource.Id.radio2);   // Subcutanea
            _radio3     = FindViewById <RadioButton>(Resource.Id.radio3);   // Intramuscular
            _radio4     = FindViewById <RadioButton>(Resource.Id.radio4);   // Intravenoso
            _radio5     = FindViewById <RadioButton>(Resource.Id.radio5);   // Inhalatoria
            _edtFecha   = FindViewById <EditText>(Resource.Id.edtFecha);    // Fecha
            _edtHora    = FindViewById <EditText>(Resource.Id.edtHora);     // Hora
            _btnAdd     = FindViewById <Button>(Resource.Id.btnAdd);        // Botón

            // Instanciamos
            _medicamento = new Medicamento();

            // Click Fecha
            _edtFecha.Click += delegate
            {
                DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
                {
                    _edtFecha.Text     = time.ToShortDateString(); // Mostrar la fecha seleccionada en el edittext
                    _medicamento.fecha = _edtFecha.Text;           // Cargamos la fecha
                });
                frag.Show(FragmentManager, DatePickerFragment.TAG);
            };

            // Click Hora
            _edtHora.Click += delegate
            {
                TimePickerFragment frag = TimePickerFragment.NewInstance(delegate(DateTime time)
                {
                    _edtHora.Text     = time.ToShortTimeString(); // Mostrar la hora seleccionada en el edittext
                    _medicamento.hora = _edtHora.Text;            // Cargamos la hora
                });

                frag.Show(FragmentManager, TimePickerFragment.TAG);
            };

            // Recibimos el Id paciente
            var id = Intent.Extras.GetInt(KEY_ID);

            // Consultamos
            _paciente        = new Paciente();
            _pacienteService = new PacienteService();
            _paciente        = _pacienteService.getPacienteById(id); // Devuelve un paciente por Id

            // Click Alertar
            _btnAdd.Click += saveAlertMedicamento;
        }
Esempio n. 8
0
        void startDateButton_Click(object sender, EventArgs e)
        {
            var dialog = DatePickerFragment.NewInstance((year, month, day) => ViewModel.StartDate = new DateTime(year, month, day),
                                                        ViewModel.StartDate.Year, ViewModel.StartDate.Month, ViewModel.StartDate.Day);

            dialog.Show(ChildFragmentManager, "startDatePicker");
        }
Esempio n. 9
0
        private void OpenPicker(object sender, EventArgs eventArgs)
        {
            var fr = new DatePickerFragment(OnDatePicked, DateOfBirthday == DateTime.MinValue ? DateTime.UtcNow : DateOfBirthday);

            fr.ShowsDialog = true;
            fr.Show(SupportFragmentManager, "DatePicker");
        }
Esempio n. 10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.RotacionAdd);

            Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            // Una marca atrás en el icono en ActionBar
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            _radioComun = FindViewById <RadioButton>(Resource.Id.radioComun); // Común
            _radioAire  = FindViewById <RadioButton>(Resource.Id.radioAire);  // Aíre
            _radio1     = FindViewById <RadioButton>(Resource.Id.radio1);     // Lateral Izquierdo
            _radio2     = FindViewById <RadioButton>(Resource.Id.radio2);     // Lateral Derecho
            _radio3     = FindViewById <RadioButton>(Resource.Id.radio3);     // Supino
            _radio4     = FindViewById <RadioButton>(Resource.Id.radio4);     // Prono

            _edtFecha = FindViewById <EditText>(Resource.Id.edtFecha);        // Fecha
            _edtHora  = FindViewById <EditText>(Resource.Id.edtHora);         // Hora
            _btnAdd   = FindViewById <Button>(Resource.Id.btnAdd);            // Botón

            // Instanciamos
            _rotacion = new Rotacion();

            // Click Fecha
            _edtFecha.Click += delegate
            {
                DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
                {
                    _edtFecha.Text  = time.ToShortDateString(); // Mostrar la fecha seleccionada en el edittext
                    _rotacion.fecha = _edtFecha.Text;           // Cargamos la fecha
                });
                frag.Show(FragmentManager, DatePickerFragment.TAG);
            };

            // Click Hora
            _edtHora.Click += delegate
            {
                TimePickerFragment frag = TimePickerFragment.NewInstance(delegate(DateTime time)
                {
                    _edtHora.Text  = time.ToShortTimeString(); // Mostrar la hora seleccionada en el edittext
                    _rotacion.hora = _edtHora.Text;            // Cargamos la hora
                });

                frag.Show(FragmentManager, TimePickerFragment.TAG);
            };

            // Recibimos el Id Paciente
            var id = Intent.Extras.GetInt(KEY_ID);

            _paciente        = new Paciente();
            _pacienteService = new PacienteService();
            _paciente        = _pacienteService.getPacienteById(id); // Devuelve Paciente por Id

            // Click Alertar
            _btnAdd.Click += saveAlertRotacion;
        }
Esempio n. 11
0
        void DateSelect_OnClick(object sender, EventArgs eventArgs)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time) {
                EditProfileCreationDateOfBirth.Text = time.ToLongDateString();
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 12
0
 public static DatePickerFragment NewInstance(Action<DateTime> onDateSelected)
 {
     DatePickerFragment frag = new DatePickerFragment
     {
         _dateSelectedHandler = onDateSelected
     };
     return frag;
 }
Esempio n. 13
0
        //--DATE----------------------------------------------------------------------------------------------------

        private void BtnSetDate_Click(object sender, EventArgs e)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate (DateTime time)
            {
                txtDate.Text = time.ToLongDateString();
            });
            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }//
Esempio n. 14
0
        private void ViewModel_ChangedDate(object sender, Presentation.Events.ChangedDateEvent e)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                //ViewModel.SelectedDate =new TraceDateDTO(e.Id, time.Date);
            }, e.Date);

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
        //При клике на выбор даты
        void DateSelect_OnClick(object sender, EventArgs eventArgs)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                _dateSelectButton.Text = time.ToString("d", CultureInfo.CreateSpecificCulture("ru-RU"));
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 16
0
        public void birthDateTextClick(View v)
        {
            var frag = DatePickerFragment.NewInstance(delegate(DateTime time) {
                birthDate.Text = time.ToLongDateString();
                dateOfBirth    = time;
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 17
0
        private void _dateSelectButton_Click(object sender, EventArgs e)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                dateEditText.Text = time.ToString("d. MMMM yyyy");
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 18
0
        /// <summary>
        /// Displays DatePickerFragment instance and updates purchase date.
        /// </summary>
        private void SelectDate()
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                ViewModel.Item.DatePurchased = new DateTime(time.Year, time.Month, time.Day);
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 19
0
        private void DatetimePickerButton_Click(object sender, EventArgs e)
        {
            var datetimeFragment = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                this.datetimeTextView.Text = time.ToLongDateString();
            });

            datetimeFragment.Show(FragmentManager, DatePickerFragment.TAG);
        }
        private void _btnFechaRenta_Click(object sender, EventArgs e)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                _txtFechaRenta.Text = time.ToLongDateString();
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
        private void TxtTransactionDate_Click(object sender, EventArgs e)
        {
            DatePickerFragment fragment = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                txtTransactionDate.Text = time.ToShortDateString();
            });

            fragment.Show(SupportFragmentManager, "DatePickerFragment");
        }
        void FillSobreMi()
        {
            EditText sobremi = profileView.FindViewById <EditText>(Resource.Id.txtSobreMi);

            sobremi.Text         = miembro.Usuario_Descripcion;
            sobremi.TextChanged += (sender, e) =>
                                   miembro.Usuario_Descripcion = ((TextView)sender).Text;

            EditText telefono = profileView.FindViewById <EditText>(Resource.Id.txtTelefono);

            telefono.Text         = miembro.Usuario_Telefono;
            telefono.TextChanged += (sender, e) =>
                                    miembro.Usuario_Telefono = ((EditText)sender).Text;

            EditText celular = profileView.FindViewById <EditText>(Resource.Id.txtCelular);

            celular.Text         = miembro.Usuario_Celular;
            celular.TextChanged += (sender, e) =>
                                   miembro.Usuario_Celular = ((EditText)sender).Text;

            EditText correo = profileView.FindViewById <EditText>(Resource.Id.txtCorreo);

            correo.Text         = miembro.Usuario_Correo_Electronico;
            correo.TextChanged += (sender, e) =>
                                  miembro.Usuario_Correo_Electronico = ((EditText)sender).Text;
            EditText nacimiento = profileView.FindViewById <EditText>(Resource.Id.txtFechaNacimiento);

            nacimiento.ShowSoftInputOnFocus = false;
            nacimiento.Click += (sender, e) =>
            {
                DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(System.DateTime time)
                {
                    ((EditText)sender).Text          = time.ToString("d");
                    miembro.Usuario_Fecha_Nacimiento = time.ToString("d");
                });
                frag.Show(context.FragmentManager, context.Resources.GetString(Resource.String.str_meeting_room_reservation));
            };


            EditText txtHabilidades = profileView.FindViewById <EditText>(Resource.Id.txtHabilidades);

            txtHabilidades.EditorAction += Etiqueta_KeyPress;
            EditText txtIntereses = profileView.FindViewById <EditText>(Resource.Id.txtIntereses);

            txtIntereses.EditorAction += Etiqueta_KeyPress;
            miembro.Etiquetas.AsParallel().ToList().ForEach(habilidad =>
            {
                if (habilidad.Etiqueta_Tipo == "Habilidad")
                {
                    FillEtiqueta(habilidad.Etiqueta_Nombre, profileView.FindViewById <RelativeLayout>(Resource.Id.rlHabilidades));
                }
                else
                {
                    FillEtiqueta(habilidad.Etiqueta_Nombre, profileView.FindViewById <RelativeLayout>(Resource.Id.rlIntereses));
                }
            });
        }
Esempio n. 23
0
        void DateSelect_OnClick(object sender, EventArgs eventArgs)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                date_pick.Text = time.ToString("MM/dd/yyyy");
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 24
0
        private void _btnFechaGasto_Click(object sender, EventArgs e)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance((time) =>
            {
                _fechaGasto.Text = time.ToLongDateString();
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
        private void _arrivalButton_Click(object sender, EventArgs e)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                _arrival = time;
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 26
0
        void DateSelect_OnClick(object sender, EventArgs eventArgs)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                _dateDisplay.Text = time.ToLongDateString();
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 27
0
        private void TxtExportFrom_Click(object sender, EventArgs e)
        {
            DatePickerFragment fragment = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                txtFrom.Text = time.ToShortDateString();
            });

            fragment.Show(Activity.SupportFragmentManager, "DatePickerFragment");
        }
Esempio n. 28
0
        private void MEdtDepartDate_Click(object sender, EventArgs e)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                mEdtDepartDate.Text = time.Date.ToShortDateString();
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }
Esempio n. 29
0
        public void ShowSetTimeDialog()
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
            {
                ViewModel.SelectedTimeCommand.Execute(time);
            });

            frag.Show(FragmentManager, "");
        }
Esempio n. 30
0
        private void StartDateImageView_Click(object sender, EventArgs e)
        {
            DatePickerFragment frag = DatePickerFragment.NewInstance(ev =>
            {
                _startDate             = ev.Date;
                startDateTextView.Text = ev.Date.ToString();
            });

            frag.Show(FragmentManager, DatePickerFragment.TAG);
        }