private void cbxSucursal_Seleccion(object sender, SelectionChangedEventArgs e)
 {
     if (cbxSucursal.SelectedValue != null)
     {
         try
         {
             int sucursal = int.Parse(cbxSucursal.SelectedValue.ToString());
             cbxEmpleado.SelectedIndex = -1;
             cbxEmpleado.IsEnabled     = false;
             CargarTablaProductos();
             txtNombreEmpleado.Text = "";
             EmpleadosNEG         empleadosNEG   = new EmpleadosNEG();
             List <EmpleadosVIEW> listaEmpleados = empleadosNEG.ListarTodosEmpleadosSucursal(sucursal);
             if (listaEmpleados.Count > 0)
             {
                 cbxEmpleado.ItemsSource       = listaEmpleados;
                 cbxEmpleado.DisplayMemberPath = "NUM_ID";
                 cbxEmpleado.SelectedValuePath = "ID";
                 cbxEmpleado.IsEnabled         = true;
             }
             SucursalNEG sucursalNEG = new SucursalNEG();
             var         datos       = sucursalNEG.CargarSucursal(sucursal);
             txtDireccion.Text = datos.DIRECCION;
             txtTelFijo.Text   = datos.NUMERO_TELEFONO.ToString();
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error:\n" + ex.TargetSite + "\n" + ex.Message.ToString());
         }
     }
 }
Exemple #2
0
        private void CargarCombos()
        {
            MultiMonedaNEG multiMonedaNEG = new MultiMonedaNEG();
            EmpleadosNEG   empleadosNEG   = new EmpleadosNEG();

            try
            {
                List <MULTI_MONEDA> listaMultiMoneda = multiMonedaNEG.ListarMultiMoneda();
                if (listaMultiMoneda.Count > 0)
                {
                    cbxMoneda.ItemsSource       = listaMultiMoneda;
                    cbxMoneda.DisplayMemberPath = "TIPO_MODONEDA";
                    cbxMoneda.SelectedValuePath = "ID";
                }
                cbxEmpleado.SelectedIndex = -1;
                cbxEmpleado.IsEnabled     = false;
                txtNombreEmpleado.Text    = "";
                List <EmpleadosVIEW> listaEmpleados = empleadosNEG.ListarTodosEmpleadosSucursal(ordenPedidoCarga.SUCURSAL_ID);
                if (listaEmpleados.Count > 0)
                {
                    cbxEmpleado.ItemsSource       = listaEmpleados;
                    cbxEmpleado.DisplayMemberPath = "NUM_ID";
                    cbxEmpleado.SelectedValuePath = "ID";
                    cbxEmpleado.IsEnabled         = true;
                }
                SucursalNEG sucursalNEG = new SucursalNEG();
                var         datos       = sucursalNEG.CargarSucursal(ordenPedidoCarga.SUCURSAL_ID);
                txtDireccion.Text = datos.DIRECCION;
                txtTelFijo.Text   = datos.NUMERO_TELEFONO.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error:\n" + ex.TargetSite + "\n" + ex.Message.ToString());
            }
        }
Exemple #3
0
 private void cbxSucursal_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (cbxSucursal.SelectedValue != null)
     {
         try
         {
             int          sucursal     = int.Parse(cbxSucursal.SelectedValue.ToString());
             EmpleadosNEG empleadosNEG = new EmpleadosNEG();
             var          datos        = empleadosNEG.ListarTodosEmpleadosSucursal(sucursal);
             cbxEmpleadoRecepcion.ItemsSource = null;
             CargarTablaProductos();
             CargarTablaServicios();
             if (datos.Count > 0)
             {
                 cbxEmpleadoRecepcion.ItemsSource       = datos;
                 cbxEmpleadoRecepcion.DisplayMemberPath = "NUM_ID";
                 cbxEmpleadoRecepcion.SelectedValuePath = "ID";
                 cbxEmpleadoRecepcion.IsEnabled         = true;
             }
             else
             {
                 cbxEmpleadoRecepcion.IsEnabled = false;
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error:\n" + ex.TargetSite + "\n" + ex.Message.ToString());
         }
     }
 }
        private void cbxSucursal_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (cbxSucursal.SelectedValue != null)
            {
                try
                {
                    int sucursal = int.Parse(cbxSucursal.SelectedValue.ToString());
                    cbxFolioOP.ItemsSource = null;
                    CargarTablaDetalle();
                    OrdenPedidoDAL   orden      = new OrdenPedidoDAL();
                    List <FolioView> listafolio = orden.ListarFoliosSucursalEnviada(sucursal);
                    if (listafolio.Count > 0)
                    {
                        cbxFolioOP.ItemsSource       = listafolio;
                        cbxFolioOP.DisplayMemberPath = "NOMBRE";
                        cbxFolioOP.SelectedValuePath = "ID";
                        cbxFolioOP.IsEnabled         = true;
                    }
                    else
                    {
                        cbxFolioOP.SelectedValue = -1;
                        cbxFolioOP.IsEnabled     = false;
                    }

                    EmpleadosNEG         empleadosNEG  = new EmpleadosNEG();
                    List <EmpleadosVIEW> listaEmpleado = empleadosNEG.ListarTodosEmpleadosSucursal(sucursal);
                    if (listaEmpleado.Count > 0)
                    {
                        cbxEmpleado.ItemsSource       = listaEmpleado;
                        cbxEmpleado.DisplayMemberPath = "NUM_ID";
                        cbxEmpleado.SelectedValuePath = "ID";
                        cbxEmpleado.IsEnabled         = true;
                    }
                    else
                    {
                        cbxEmpleado.SelectedValue = -1;
                        cbxEmpleado.IsEnabled     = false;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error:\n" + ex.TargetSite + "\n" + ex.Message.ToString());
                }
            }
        }