Ejemplo n.º 1
0
 public void buscarPorRazonSocial()
 {
     listaPresupuestos = presupuesto.obtenerListaPorRazonSocial(presupuesto.conocerClienteMayorista(txt_razonSocial.Text));
     if (listaPresupuestos.Count != 0)
     {
         foreach (var item in listaPresupuestos)
         {
             Encargado encargado = presupuesto.conocerEncargado(item.CodigoEncargado);
             dgv_presupuestos.Rows.Add(item.CodigoPresupuesto,
                                       "",
                                       presupuesto.conocerClienteMayorista(item.CodigoClienteMayorista).RazonSocial,
                                       item.Fecha.ToString("dd/MM/yyyy"),
                                       item.FechaVencimiento.ToString("dd/MM/yyyy"),
                                       item.ImporteTotal,
                                       encargado.Nombre + " " + encargado.Apellido);
         }
     }
     else
     {
         MessageBox.Show("No hay presupuestos asociados al criterio de busqueda ingresado");
     }
 }
 public void registrarPresupuesto()
 {
     if (razonSocial != "")
     {
         presupuesto.CodigoClienteMayorista = presupuesto.conocerClienteMayorista(razonSocial);
     }
     calcularFechaVencimiento();
     presupuesto.CodigoEncargado   = InterfazRegistrarPresupuesto.InterfazContenedora.EncargadoActivo.CodigoEncargado;
     presupuesto.CodigoPresupuesto = presupuesto.ultimoCodigoPresupuesto() + 1;
     if (mostrarVistaPrevia())
     {
         presupuesto.crear(presupuesto);
         registrarDetalleVP();
         InterfazRegistrarPresupuesto.limpiarCampos();
         MessageBox.Show("El presupuesto se ha registrado con exito", "Informacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
         InterfazRegistrarPresupuesto.Close();
     }
 }
Ejemplo n.º 3
0
        public void iniciarVenta()
        {
            if (DateTime.Now > presupuesto.FechaVencimiento)
            {
                MessageBox.Show("El presupuesto esta vencido, los precios pueden variar", "Informacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            interfazVentaMostrador = new IU_RegistrarVenta();
            interfazVentaMostrador.gb_tipoCliente.Enabled = false;

            if (presupuesto.CodigoClienteMayorista != 0)
            {
                interfazVentaMostrador.rb_clienteMayorista.Checked = true;
                interfazVentaMostrador.txt_razonSocial.Text        = presupuesto.conocerClienteMayorista(presupuesto.CodigoClienteMayorista).RazonSocial;
            }

            int bandera = 0; //Se crea esta bandera para saber si se cargaron todos los articulos o no.

            foreach (var item in this.listaDetalle)
            {
                interfazVentaMostrador.controlador.codigoArticulo = item.CodigoArticulo;
                interfazVentaMostrador.controlador.cantidad       = item.Cantidad;
                interfazVentaMostrador.controlador.buscarDatosArticulos(interfazVentaMostrador.controlador.codigoArticulo);
                if (!interfazVentaMostrador.controlador.verificarStock())
                {
                    bandera = 1;
                }
            }

            interfazVentaMostrador.InterfazContenedora = interfazConsultarPresupuesto.InterfazContenedora;
            interfazVentaMostrador.Show();
            if (bandera != 0)
            {
                MessageBox.Show("Algunos de los articulos no se cargaron por falta de stock", "Informacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }