Ejemplo n.º 1
0
 public List <DetalleLogistica> conocerDetalleLogistica(int codigoEntrega)
 {
     acceso   = new AccesoDatos();
     conexion = new SqlConnection(acceso.CadenaConexion());
     consulta = new SqlCommand("select codigoDetalleLogistica, codigoArticulo, cantidad from DetallesLogistica where codigoEntrega='" + codigoEntrega + "'", conexion);
     try
     {
         conexion.Open();
         lector = consulta.ExecuteReader();
         while (lector.Read())
         {
             Detalle.Add(new DetalleLogistica()
             {
                 CodigoDetalleLogistica = int.Parse(lector["codigoDetalleLogistica"].ToString()), Cantidad = int.Parse(lector["cantidad"].ToString()), CodigoArticulo = int.Parse(lector["codigoArticulo"].ToString())
             });
         }
         return(Detalle);
     }
     catch (SqlException)
     {
         return(Detalle);
     }
     finally
     {
         conexion.Close();
     }
 }
Ejemplo n.º 2
0
        public virtual void ChangeEstado(Estado nuevoEstado, string observacion, Empleado empleado)
        {
            if (empleado == null)
            {
                throw new ArgumentNullException("empleado");
            }

            if (!Next(UltimoEstado).Any(e => e == nuevoEstado))
            {
                throw new Exception(string.Format("Cambio de estado invalido {0} -> {1}", UltimoEstado, nuevoEstado));
            }

            Final = GetEstadoFinal(nuevoEstado);

            var detalle = new DetalleTicketRechazo
            {
                // Ultimo estado es calculado solo se actualiza en memoria
                Estado      = nuevoEstado,
                FechaHora   = DateTime.UtcNow,
                Observacion = observacion,
                Ticket      = this,
                Empleado    = empleado
            };

            Detalle.Add(detalle);
        }
Ejemplo n.º 3
0
        private void Agregarbutton_Click(object sender, EventArgs e)
        {
            List <TelefonoDetalle> telefonoDetalles = new List <TelefonoDetalle>();

            if (Validar(2))
            {
                MessageBox.Show("Llene los Campos", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                Detalle.Add(new TelefonoDetalle(
                                id: 0,
                                idPersona: (int)IdnumericUpDown.Value,
                                telefonos: TelefonomaskedTextBox.Text,
                                typeTelefono: TypecomboBox.Text

                                ));

                //Cargar el detalle al Grid
                CargarGrid();
                TelefonomaskedTextBox.Focus();
                TelefonomaskedTextBox.Clear();
                TypecomboBox.ResetText();
                DetalledataGridView.DataSource = null;
            }
        }
Ejemplo n.º 4
0
        private void btnRemoverFila_Click(object sender, EventArgs e)
        {
            if (DetalleDataGridView1.Rows.Count > 0 && DetalleDataGridView1.CurrentRow != null)
            {
                if (RowSelected >= 0)
                {
                    Personas persona = LlenaClase();

                    TelefonosDetalle tel = persona.Telefonos.ElementAt(RowSelected);
                    Detalle.Add(new TelefonosDetalle(tel.Id, tel.PersonaId, tel.TipoTelefono, tel.Telefono));
                    persona.Telefonos.RemoveAt(RowSelected);
                    DetalleDataGridView1.DataSource = null;
                    DetalleDataGridView1.DataSource = persona.Telefonos;
                    RowSelected = -1;
                    MessageBox.Show("Eliminado!");
                }
            }
        }
        public override bool Aceptar()
        {
            var  vm = this.VistaModeloDetalleInstancia as VMItemDescuentoPorLista;
            bool ok;

            if (vm.Articulos.Count == 0)
            {
                ok = base.Aceptar();
            }
            else
            {
                this.Detalle.Remove(this.Objeto);
                this.Cancelar();
                vm.Articulos.ForEach(a => Detalle.Add(new ItemDescuentoPorLista()
                {
                    Articulo = a, Descuentos = vm.Modelo.Descuentos
                }));
                ok = true;
            }
            return(ok);
        }
Ejemplo n.º 6
0
        public override bool Aceptar()
        {
            bool ok;

            if (Articulos.Count == 0)
            {
                ok = base.Aceptar();
            }
            else
            {
                this.Cancelar();
                this.Articulos.ForEach(a => Detalle.Add(new ItemListaDePreciosDeVenta()
                {
                    Articulo = a
                }));
                this.Articulos.Clear();
                this.PresentadorMiniBuscaArticulo.PMD.Detalle.Clear();
                ok = true;
            }
            return(ok);
        }
Ejemplo n.º 7
0
        public TicketRechazo(string observacion, Empleado empleado, DateTime fechaHora)
        {
            if (empleado == null)
            {
                throw new ArgumentNullException("empleado");
            }

            Final = EstadoFinal.SolucionPendiente;

            var detalle = new DetalleTicketRechazo()
            {
                Estado      = Estado.Pendiente,
                FechaHora   = fechaHora,
                Observacion = observacion,
                Ticket      = this,
                Empleado    = empleado
            };

            FechaHora = fechaHora;

            Detalle.Add(detalle);
        }
Ejemplo n.º 8
0
 public void AgregarDetalle(Comprobante _comprobante, Producto _producto, int _cantidad)
 {
     Detalle.Add(DetalleComprobante.Registrar(_comprobante, _producto, _cantidad));
 }