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; }
private void Dtp_RequestEndTime_Click(object sender, EventArgs e) { InputMethodManager inputManager = (InputMethodManager)this.GetSystemService(Context.InputMethodService); inputManager.HideSoftInputFromWindow(this.CurrentFocus.WindowToken, HideSoftInputFlags.NotAlways); TimePickerFragment frag = TimePickerFragment.NewInstance(delegate(TimeSpan time) { String aMpM = "AM"; if (time.Hours > 11) { aMpM = "PM"; } //Make the 24 hour time format to 12 hour time format int currentHour; if (time.Hours > 11) { currentHour = time.Hours - 12; } else { currentHour = time.Hours; } dtp_RequestEndTime.Text = currentHour + ":" + time.Minutes + " " + aMpM; }); frag.Show(FragmentManager, TimePickerFragment.TAG); }
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; }
void TimeSelect_OnClick(object sender, EventArgs eventArgs) { TimePickerFragment frag = TimePickerFragment.NewInstance(delegate(TimeSpan time) { time_pick.Text = time.ToString(); }); frag.Show(FragmentManager, TimePickerFragment.TAG); }
//----TIME----------------------------------------------------------------------------------------------- private void BtnSetTime_Click(object sender, EventArgs e) { TimePickerFragment frag = TimePickerFragment.NewInstance( delegate (DateTime time) { txtTime.Text = time.ToShortTimeString(); }); frag.Show(FragmentManager, TimePickerFragment.TAG); }//
//При клике на выбор времени private void TimeSelect_OnClick(object sender, EventArgs eventArgs) { TimePickerFragment frag = TimePickerFragment.NewInstance(delegate(DateTime time) { _timeSelectButton.Text = time.ToString("HH:mm"); }); frag.Show(FragmentManager, TimePickerFragment.TAG); }
private void PillTimesListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { TimePickerFragment frag = TimePickerFragment.NewInstance(delegate(DateTime time) { pillTimes[e.Position] = time; timeListAdapter.NotifyDataSetChanged(); }); frag.Show(FragmentManager, TimePickerFragment.TAG); }
void TimeSelectOnClick(object sender, EventArgs eventArgs) { TimePickerFragment frag = TimePickerFragment.NewInstance( delegate(DateTime time) { startingTimeTxtView.Text = time.ToShortTimeString(); }); frag.Show(FragmentManager, TimePickerFragment.TAG); }
//private void BtnSelectEndTime_Click(object sender, EventArgs e) //selecting times/dates //{ // TimePickerFragment frag1 = TimePickerFragment.NewInstance(delegate (TimeSpan time1) // { // btnSelectEndTime.Text = "End Time: " + time1.ToString(); // EndTime = time1.ToString(); // }); // frag1.Show(FragmentManager, TimePickerFragment.TAG); //} private void BtnSelectTime_Click(object sender, EventArgs e) { TimePickerFragment frag = TimePickerFragment.NewInstance(delegate(TimeSpan time) { btnSelectTime.Text = "Start Time: " + time.ToString(); StartTime = time.ToString(); }); frag.Show(FragmentManager, TimePickerFragment.TAG); }
private void Txt_start_time_val_Click(object sender, EventArgs e) { TimePickerFragment frag = TimePickerFragment.NewInstance(delegate(TimeSpan time) { startTimeSpan = time; txt_start_time_val.Text = startTimeSpan.ToString(); }); frag.Show(FragmentManager, TimePickerFragment.TAG); }
private void StartTimeImageView_Click(object sender, EventArgs e) { TimePickerFragment frag = TimePickerFragment.NewInstance(ev => { _startTime = ev.Time; startTimeTextView.Text = ev.Time.ToString(); }); frag.Show(FragmentManager, TimePickerFragment.TAG); }
}// public void TimeSelectOnClick(object sender, EventArgs eventArgs) { TimePickerFragment frag = TimePickerFragment.NewInstance( delegate(DateTime time) { timeDisplay.Text = time.ToShortTimeString(); }); frag.Show(FragmentManager, TimePickerFragment.TAG); //combinedTextView.Text = combinedDateTime.ToLongTimeString(); // "time selected working"; ... not needed ?? }
void TimeSelectOnClick(object sender, EventArgs e) { TimePickerFragment frag = TimePickerFragment.NewInstance(delegate(DateTime time) { eventTime.Text = time.ToShortTimeString(); hour = time.Hour; minute = time.Minute; }); frag.Show(FragmentManager, TimePickerFragment.TAG); }
void TimeSelectOnClick(object sender, EventArgs eventArgs) { TimePickerFragment frag = TimePickerFragment.NewInstance( delegate(DateTime time) { _timeDisplay.Text = time.ToShortTimeString(); reminder.Time = _timeDisplay.Text; }); frag.Show(FragmentManager, TimePickerFragment.TAG); }
private void EndTimeImageView_Click(object sender, EventArgs e) { TimePickerFragment frag = TimePickerFragment.NewInstance(ev => { _endTime = ev.Time; endTimeTextView.Text = ev.Time.ToString(); }, _scheduledTask.End); frag.Show(FragmentManager, TimePickerFragment.TAG); }
private void TimeSet_Click(object sender, EventArgs e) { TimePickerFragment frag = TimePickerFragment.NewInstance( delegate(DateTime times) { timeDisplay.Text = times.ToShortTimeString(); alarmtime = times; timeswitch = true; }); frag.Show(FragmentManager, TimePickerFragment.TAG); AlarmSwitch(); }
public void OnClick(View v) { try { if (v.Id == TxtStartTime.Id) { var frag = TimePickerFragment.NewInstance(delegate(DateTime time) { TxtStartTime.Text = time.ToShortTimeString(); }); frag.Show(SupportFragmentManager, TimePickerFragment.Tag); } else if (v.Id == TxtEndTime.Id) { var frag = TimePickerFragment.NewInstance(delegate(DateTime time) { TxtEndTime.Text = time.ToShortTimeString(); }); frag.Show(SupportFragmentManager, TimePickerFragment.Tag); } else if (v.Id == TxtStartDate.Id) { var frag = DatePickerFragment.NewInstance(delegate(DateTime time) { TxtStartDate.Text = time.Date.ToString("yy-MM-dd"); }); frag.Show(SupportFragmentManager, DatePickerFragment.Tag); } else if (v.Id == TxtEndDate.Id) { var frag = DatePickerFragment.NewInstance(delegate(DateTime time) { TxtEndDate.Text = time.Date.ToString("yy-MM-dd"); }); frag.Show(SupportFragmentManager, DatePickerFragment.Tag); } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
public void OnClick(View v) { try { if (v.Id == TxtStartTime.Id) { var frag = TimePickerFragment.NewInstance(delegate(DateTime time) { TxtStartTime.Text = time.ToShortTimeString(); }); frag.Show(SupportFragmentManager, TimePickerFragment.Tag); } else if (v.Id == TxtEndTime.Id) { var frag = TimePickerFragment.NewInstance(delegate(DateTime time) { TxtEndTime.Text = time.ToShortTimeString(); }); frag.Show(SupportFragmentManager, TimePickerFragment.Tag); } else if (v.Id == TxtStartDate.Id) { var frag = DatePickerFragment.NewInstance(delegate(DateTime time) { TxtStartDate.Text = time.ToShortDateString(); }); frag.Show(SupportFragmentManager, DatePickerFragment.Tag); } else if (v.Id == TxtEndDate.Id) { var frag = DatePickerFragment.NewInstance(delegate(DateTime time) { TxtEndDate.Text = time.ToShortDateString(); }); frag.Show(SupportFragmentManager, DatePickerFragment.Tag); } } catch (Exception e) { Console.WriteLine(e); } }
public void OnClick(View v) { try { if (v.Id == TxtStartTime.Id) { var frag = TimePickerFragment.NewInstance(delegate(DateTime time) { TxtStartTime.Text = time.ToShortTimeString(); }); frag.Show(FragmentManager, TimePickerFragment.TAG); } else if (v.Id == TxtEndTime.Id) { var frag = TimePickerFragment.NewInstance(delegate(DateTime time) { TxtEndTime.Text = time.ToShortTimeString(); }); frag.Show(FragmentManager, TimePickerFragment.TAG); } else if (v.Id == TxtStartDate.Id) { var frag = DatePickerFragment.NewInstance(delegate(DateTime time) { TxtStartDate.Text = time.ToShortDateString(); }); frag.Show(FragmentManager, DatePickerFragment.TAG); } else if (v.Id == TxtEndDate.Id) { var frag = DatePickerFragment.NewInstance(delegate(DateTime time) { TxtEndDate.Text = time.ToShortDateString(); }); frag.Show(FragmentManager, DatePickerFragment.TAG); } } catch (Exception e) { Crashes.TrackError(e); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.InvitadosLayout); SimpleStorage.SetContext(ApplicationContext); storage = SimpleStorage.EditGroup("Login"); Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetActionBar(toolbar); ActionBar.Title = Resources.GetString(Resource.String.RegistroInvitados); ActionBar.SetDisplayHomeAsUpEnabled(true); TextView lblFecha = FindViewById <TextView>(Resource.Id.lblFecha); lblFecha.Text = DateTime.Now.ToString("MMMM dd, yyyy hh:mm tt").ToUpper(); FindViewById <Button>(Resource.Id.btnFecha).Click += (sender, e) => { DatePickerMinFragment frag = DatePickerMinFragment.NewInstance(delegate(DateTime time) { TimePickerFragment timeFrag = TimePickerFragment.NewInstance(delegate(DateTime hour) { lblFecha.Text = time.ToString("MMMM dd, yyyy ").ToUpper() + hour.ToString("hh:mm tt"); }); timeFrag.Show(FragmentManager, Resources.GetString(Resource.String.str_meeting_room_reservation)); }); frag.Show(FragmentManager, Resources.GetString(Resource.String.str_meeting_room_reservation)); }; Nombre = FindViewById <EditText>(Resource.Id.txtNombre); Apellidos = FindViewById <EditText>(Resource.Id.txtApellidos); Correo = FindViewById <EditText>(Resource.Id.txtEmail); DatosBasicos = FindViewById <LinearLayout>(Resource.Id.llInvitados); Spinner ubicacion = FindViewById <Spinner>(Resource.Id.spUbicacion); Dictionary <string, string> sucursales = new SucursalController().GetSucursalInfo(); List <string> display = sucursales.Keys.ToList(); ubicacion.Adapter = new ArrayAdapter <string>(this, Resource.Drawable.spinner_style, display); EditText txtAsunto = FindViewById <EditText>(Resource.Id.txtAsunto); FindViewById <TextView>(Resource.Id.lblAgregarInvitado).Click += (sender, e) => AddDatosBasicos(); FindViewById <TextView>(Resource.Id.lblEnviar).Click += delegate { List <int> invitados_id = new List <int>(); AssetManager asset = Assets; correoInvitacion = new StreamReader(asset.Open("Invitacion.html")).ReadToEnd(); SucursalModel sucursal = new SucursalController().GetSucursalInfo(sucursales[ubicacion.SelectedItem.ToString()]); invitados.AsParallel().ToList().ForEach(invitado => { try { invitados_id.Add(new InvitadosController().RegistraInvitado(invitado.Usuario_Nombre, invitado.Usuario_Apellidos, invitado.Usuario_Correo_Electronico, txtAsunto.Text, DateTime.Parse(lblFecha.Text), sucursales[ubicacion.SelectedItem.ToString()], storage.Get("Usuario_Id"), storage.Get("Usuario_Tipo"))); email.SendMail(invitado.Usuario_Correo_Electronico, invitado.Usuario_Nombre + " " + invitado.Usuario_Apellidos, correoInvitacion.Replace("{{NOMBRE}}", invitado.Usuario_Nombre + " " + invitado.Usuario_Apellidos) .Replace("{{FECHA}}", lblFecha.Text) .Replace("{{SUCURSAL}}", sucursal.Sucursal_Descripcion) .Replace("{{CALLE}}", sucursal.Sucursal_Domicilio) .Replace("{{COLONIA}}", sucursal.Territorio.Colonia) .Replace("{{QR}}", "INVITADO"), "Tiene una invitación"); Toast.MakeText(this, Resource.String.str_general_data_saved, ToastLength.Short).Show(); } catch (Exception e) { Toast.MakeText(this, Resource.String.str_general_save_error, ToastLength.Short).Show(); SlackLogs.SendMessage(e.Message, GetType().Name, "OnCreate"); } }); if (invitados_id.Count != 0) { Intent intent = new Intent(this, typeof(InvitadosConfirmacionActivity)); intent.PutExtra("Invitados_Id", JsonConvert.SerializeObject(invitados_id)); StartActivity(intent); Finish(); } }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.MedicamentoEdit); 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.edtFarmaco); // Farmaco _edtDosis = FindViewById <EditText>(Resource.Id.edtDosis); // 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 _btnEdit = FindViewById <Button>(Resource.Id.btnEdit); // Botón // 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 Medicamento var id = Intent.Extras.GetInt(KEY_ID); // Instanciamos _medicamento = new Medicamento(); _medicamentoService = new MedicamentoService(); // Consultamos la lista medicamentos de un paciente por Id _medicamento = _medicamentoService.getMedicamentoPacienteById(id); // Mostramos los datos _edtFarmaco.Text = _medicamento.farmaco; _edtDosis.Text = _medicamento.dosis.ToString(); //ToString: convierte de entero a string if (_medicamento.viaOral == true) { _radio1.Checked = true; } if (_medicamento.viaSubcutanea == true) { _radio2.Checked = true; } if (_medicamento.viaIntramuscular == true) { _radio3.Checked = true; } if (_medicamento.viaIntravenoso == true) { _radio4.Checked = true; } if (_medicamento.viaInhalatoria == true) { _radio5.Checked = true; } _edtFecha.Text = _medicamento.fecha; _edtHora.Text = _medicamento.hora; // Click Actualizar _btnEdit.Click += updateAlertMedicamento; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.RotacionEdit); 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 _btnEdit = FindViewById <Button>(Resource.Id.btnEdit); // 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 Rotación var id = Intent.Extras.GetInt(KEY_ID); _rotacion = new Rotacion(); _rotacionService = new RotacionService(); // Consultamos la lista rotación de paciente pot Id _rotacion = _rotacionService.getRotacionPacienteById(id); // Mostramos los datos if (_rotacion.comun == true) { _radioComun.Checked = true; } if (_rotacion.aire == true) { _radioAire.Checked = true; } if (_rotacion.lateralIzq == true) { _radio1.Checked = true; } if (_rotacion.lateralDer == true) { _radio2.Checked = true; } if (_rotacion.supina == true) { _radio3.Checked = true; } if (_rotacion.prono == true) { _radio4.Checked = true; } _edtFecha.Text = _rotacion.fecha; _edtHora.Text = _rotacion.hora; // Click Alertar _btnEdit.Click += updateAlertRotacion; }