コード例 #1
0
        protected void RegresarEstado(Devoluciones d)
        {
            Equipos             eq = new Equipos();
            DevolucionesDetalle dd = new DevolucionesDetalle();

            d.Buscar(Utilitarios.ConvertirAentero(IdTextBox.Text));

            foreach (var a in d.Detalle)
            {
                eq.Buscar(a.EquipoId);
                eq.Editarestado(2);
            }
        }
コード例 #2
0
        //——————————————————————————————————————————————————————————————[ Agregar Fila ]———————————————————————————————————————————————————————————————
        private void AgregarFilaButton_Click(object sender, RoutedEventArgs e)
        {
            //—————————————————————————————————[ Libro Id ]—————————————————————————————————
            if (ProductoIdComboBox.Text == string.Empty)
            {
                MessageBox.Show("El Campo (Producto Id) está vacío.\n\nPorfavor, Seleccione el Producto.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
                ProductoIdComboBox.IsDropDownOpen = true;
                return;
            }
            if (CantidadTextBox.Text == string.Empty)
            {
                MessageBox.Show("El Campo (Cantidad) está vacio.\n\nEscriba la cantidad de productos devueltos", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning);
                CantidadTextBox.Focus();
                return;
            }

            var filaDetalle = new DevolucionesDetalle
            {
                DevolucionId = this.devoluciones.DevolucionId,
                ProductoId   = Convert.ToInt32(ProductoIdComboBox.SelectedValue.ToString()),
                //——————————————————————————————[ Nombre en el ComboBox ]——————————————————————————————
                productos = (Productos)ProductoIdComboBox.SelectedItem,
                //—————————————————————————————————————————————————————————————————————————————————————
                Cantidad = Convert.ToDouble(CantidadTextBox.Text.ToString())
            };
            //——————————————————————————————[ Total]——————————————————————————————
            double cant = (double.Parse(CantidadTextBox.Text));

            devoluciones.TotalDevoluciones += cant;
            //——————————————————————————————————————————————————————————————————————————
            this.devoluciones.Detalle.Add(filaDetalle);
            Cargar();

            ProductoIdComboBox.SelectedIndex = -1;
            CantidadTextBox.Clear();
        }