private void cboProfesionales_SelectedIndexChanged(object sender, EventArgs e) { cboFechasDisponibles.Items.Clear(); if (cboProfesionales.SelectedIndex <= 0) { cboFechasDisponibles.Enabled = false; return; } Especialidad especialidad = (Especialidad)cboEspecialidades.SelectedItem; Profesional profesional = (Profesional)cboProfesionales.SelectedItem; cboFechasDisponibles.Enabled = true; cboFechasDisponibles.Items.Add("-- Elija una fecha --"); using (ProfesionalDAO dao = new ProfesionalDAO()) { List <String> fechas = dao.getFechasDisponibles(profesional.codigo, especialidad.EspecialidadId); foreach (String fecha in fechas) { //Se filtra por fecha de sistema, no se ofrecen las opciones que sean anteriores. DateTime datefecha = DateTime.Parse(fecha); DateTime fechaActual = FechaSistema.getFechaActual(); if (DateTime.Compare(datefecha, fechaActual) >= 0) { cboFechasDisponibles.Items.Add(fecha); } } cboFechasDisponibles.SelectedIndex = 0; } }
private void cargaDatos() { try { ComboBoxManager cbm = new ComboBoxManager(); string chofer_seleccionado = ""; string automovil_seleccionado = ""; if (SingletonUsuario.Instance.rol_actual.nombre == "Chofer") { chofer_seleccionado = cargaChoferSeleccionado(SingletonUsuario.Instance.id); comboBoxChofer.Enabled = false; automovil_seleccionado = cargaAutomovilSeleccionado(SingletonUsuario.Instance.id); } comboBoxChofer = cbm.Chofer(comboBoxChofer, chofer_seleccionado); comboBoxAutomovil = cbm.Automovil(comboBoxAutomovil, automovil_seleccionado); comboBoxCliente = cbm.Cliente(comboBoxCliente); comboBoxTurno = cbm.Turno(comboBoxTurno); dateTimePickerFechaInicio.Value = FechaSistema.getDateTime(); dateTimePickerFechaFin.Value = FechaSistema.getDateTime(); dateTimePickerFechaInicio.CustomFormat = "dd/MM/yyyy - HH:mm"; dateTimePickerFechaFin.CustomFormat = "dd/MM/yyyy - HH:mm"; } catch (Exception exception) { throw new Exception(exception.Message); } }
public BaseController() { ViewData["FechaSistema"] = FechaSistema.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture); System.Web.HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)); System.Web.HttpContext.Current.Response.Cache.SetValidUntilExpires(false); System.Web.HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); System.Web.HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache); System.Web.HttpContext.Current.Response.Cache.SetNoStore(); }
private async void cargarFecha() { try { FechaSistema date = await fechaModel.fechaSistema(); lblFechaFin.Text = date.fecha.ToString(); } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message, "Cargar Fecha", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void cargaDatos() { try { ComboBoxManager cbm = new ComboBoxManager(); comboBoxChofer = cbm.Chofer(comboBoxChofer); comboBoxTurno = cbm.Turno(comboBoxTurno); dateTimePickerFecha.Value = FechaSistema.getDateTime(); } catch (Exception exception) { MessageBox.Show(exception.Message, "Error en rendicion", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public async Task <FechaSistema> fechaSistema() { try { // localhost/admeli/xcore/services.php/fechasystema FechaSistema data = await webService.GET <FechaSistema>("fechasystema"); return(data); } catch (Exception ex) { throw ex; } }
private void cargaDatos() { try { ComboBoxManager cbm = new ComboBoxManager(); comboBoxCliente = cbm.Cliente(comboBoxCliente); dateTimePickerFecha.CustomFormat = "MM/yyyy"; dateTimePickerFecha.ShowUpDown = true; dateTimePickerFecha.Value = FechaSistema.getDateTime(); } catch (Exception exception) { MessageBox.Show(exception.Message, "Error en facturacion", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private async void fechaSistema() { try { //No existe un Modelo para fechaSistema, por ello se hace directmente //http://localhost:8085/admeli/xcore/services.php/fechasystema Modelo.Recursos.WebService webService = new Modelo.Recursos.WebService(); FechaSistema fecha = await webService.GET <FechaSistema>("fechasystema"); dtpFechaCalendario.Value = fecha.fecha; } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message, "Cargar", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public ActionResult Crear() { ViewData["Accion"] = "Crear"; var distribucion = new DistribucionMercaderia { IdOperacion = IdOperacion, FechaDocumento = FechaSistema, FechaEntrega = FechaSistema.AddDays(30) }; CompraSeleccionada = new Compra(); DetalleTransferencia = new List <MovimientoProducto>(); PrepararDatos(ref distribucion); return(PartialView("DistribucionMercaderiaPanel", distribucion)); }
public ActionResult Crear() { ViewData["Accion"] = "Crear"; var ordenPedido = new OrdenPedido { IdOperacion = IdOperacion, FechaDocumento = FechaSistema, FechaEntrega = FechaSistema.AddDays(30), Estado = (int)TipoEstadoDocumento.Pendiente, }; DetalleOrdenPedido = new List <MovimientoProducto>(); PrepararDatos(ref ordenPedido); return(PartialView("OrdenPedidoPanel", ordenPedido)); }
private async void cargarFechas() { try { //Cargar la fecha del sistema FechaSistema fechaSistema = await fechaModel.fechaSistema(); maxAnio = fechaSistema.fecha.Year; maxMes = fechaSistema.fecha.Month; limitarComboAnio(maxAnio); limitarComboMes(maxMes); } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message, "Cargar Fecha", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public ActionResult Crear() { ViewData["Accion"] = "Crear"; var transaccion = new Transferencia { IdOperacion = IdOperacion, FechaDocumento = FechaSistema, FechaEntrega = FechaSistema.AddDays(30), Estado = (int)TipoEstadoDocumento.Pendiente, IdAlmacen = 0, IdAlmacenAlterno = 0 }; DetalleTransferencia = new List <MovimientoProducto>(); PrepararDatos(ref transaccion); return(PartialView("TransferenciaMercaderiaPanel", transaccion)); }
private void cargaCliente(int cliente_id = Entidad.NUEVO) { try { if (cliente_id == Entidad.NUEVO) { dateTimePickerFechaNacimiento.Value = FechaSistema.getDateTime(); cliente = new Cliente(); Usuario usuario_mapper = new Usuario(); List <Usuario> usuarios = usuario_mapper.ObtenerUsuarios(); comboBoxUsuarios.DisplayMember = "Text"; comboBoxUsuarios.ValueMember = "Value"; comboBoxUsuarios.Items.Add(new { Text = "Seleccione el usuario", Value = 0 }); foreach (Usuario usuario in usuarios) { comboBoxUsuarios.Items.Add(new { Text = usuario.usuario, Value = usuario.id }); } comboBoxUsuarios.SelectedIndex = 0; } else { Cliente cliente_mapper = new Cliente(); this.cliente = cliente_mapper.Mapear(cliente_id); checkBox1.Checked = cliente.habilitado; textBoxNombre.Text = cliente.nombre; textBoxApellido.Text = cliente.apellido; textBoxMail.Text = cliente.mail; textBoxDNI.Text = Convert.ToString(cliente.dni); textBoxTelefono.Text = Convert.ToString(cliente.telefono); textBoxDireccion.Text = cliente.direccion; textBoxCodigoPostal.Text = cliente.codigo_postal; dateTimePickerFechaNacimiento.Value = cliente.fecha_nacimiento; comboBoxUsuarios.Enabled = false; comboBoxUsuarios.DisplayMember = "Text"; comboBoxUsuarios.ValueMember = "Value"; comboBoxUsuarios.Items.Add(new { Text = cliente.usuario.usuario, Value = cliente.usuario.id }); comboBoxUsuarios.SelectedIndex = 0; } } catch (Exception exception) { MessageBox.Show(exception.Message, "Cliente error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void cargaDatos() { dateTimePickerFecha.CustomFormat = "yyyy"; dateTimePickerFecha.ShowUpDown = true; dateTimePickerFecha.Value = FechaSistema.getDateTime(); }