private void CargaDatos() { string[] Dias = { "Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado" }; DatosCehavi datos1 = new DatosCehavi(); datos1.Connect(); datos1.CargaComboBoxData(this.comboBoxTerapeutas, "select Id,Nombre from terapeutas order by Nombre"); /* * DataTable DatosTerapuetas = datos1.LoadData("select Id, Nombre from terapeutas order by Nombre"); * this.comboBoxTerapeutas.ItemsSource = DatosTerapuetas.DefaultView; * this.comboBoxTerapeutas.DisplayMemberPath = DatosTerapuetas.Columns["Nombre"].ToString(); * this.comboBoxTerapeutas.SelectedValuePath = DatosTerapuetas.Columns["Id"].ToString(); */ datos1.CargaComboBoxData(this.Repeticion, "select Id,Nombre from repeticion"); if (this.curTerapia == 0) { this.textBox.Text = "45"; this.Repeticion.SelectedValue = 1; this.comboBoxTerapeutas.SelectedValue = 1; } else { DataTable datosTerapia = datos1.LoadData("select Fecha, Duracion, IdTerapeuta, Fecha2, Dia, Hora, Periodo from terapias where Id=" + this.curTerapia.ToString()); Byte Dia = (Byte)datosTerapia.Rows[0]["Dia"]; Int16 Duracion = (Int16)datosTerapia.Rows[0]["Duracion"]; Int16 IdTerapueta = (Int16)datosTerapia.Rows[0]["IdTerapeuta"]; Int16 Periodo = (Int16)datosTerapia.Rows[0]["Periodo"]; // Byte Hora = (Byte)datosTerapia.Rows[0]["Hora"]; // Byte Minuto = (Byte)datosTerapia.Rows[0]["Minuto"]; DateTime curFecha = (DateTime)datosTerapia.Rows[0]["Fecha"]; DateTime endFecha = (DateTime)datosTerapia.Rows[0]["Fecha2"]; DateTime Hora = (DateTime)datosTerapia.Rows[0]["Hora"]; this.Repeticion.SelectedValue = Periodo; this.comboBoxTerapeutas.SelectedValue = IdTerapueta; this.textBox.Text = Duracion.ToString(); //this.Repeticion.SelectedValue = 1; this.Fecha.Text = Dias[Dia]; this.Hora.Text = Hora.ToShortTimeString(); //this.Fecha.Text = curFecha.ToString("yyyy-MM-dd HH:mm:ss"); this.datePicker0.SelectedDate = curFecha; this.datePicker1.SelectedDate = endFecha; } }
private void CargaDatos() { DatosCehavi datos1 = new DatosCehavi(); datos1.Connect(); datos1.CargaComboBoxData(this.comboBox_Estado, "select Id,Nombre from EstadoEventos1 order by Id"); this.comboBox_Estado.SelectedValue = 1; }
private void CargaDatos() { string[] Dias = { "Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado" }; DatosCehavi datos1 = new DatosCehavi(); datos1.Connect(); datos1.CargaComboBoxData(this.comboBoxTerapeutas, "select Id,Nombre from terapeutas order by Nombre"); if (this.curCita == 0) { this.textBox.Text = "45"; this.comboBoxTerapeutas.SelectedValue = 1; this.comentarios.Text = ""; } else { DataTable datosCita = datos1.LoadData("select Fecha, Duracion, IdTerapeuta from Citas where Id=" + this.curCita.ToString()); Int16 Duracion = (Int16)datosCita.Rows[0]["Duracion"]; Int16 IdTerapueta = (Int16)datosCita.Rows[0]["IdTerapeuta"]; DateTime FechaCita = (DateTime)datosCita.Rows[0]["Fecha"]; string comentarios = (string)datosCita.Rows[0]["comentarios"]; this.comboBoxTerapeutas.SelectedValue = IdTerapueta; this.textBox.Text = Duracion.ToString(); this.comentarios.Text = comentarios; this.Fecha.Text = FechaCita.ToShortDateString(); this.Hora.Text = FechaCita.ToShortTimeString(); //this.Fecha.Text = curFecha.ToString("yyyy-MM-dd HH:mm:ss"); } }