private void VendedorIdComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Vendedores vendedor = VendedoresBLL.Buscar(Convert.ToInt32(VendedorIdComboBox.SelectedValue));

            NombreVendedorLabel.Content   = vendedor.Nombres;
            ApellidovendedorLabel.Content = vendedor.Apellidos;
        }
        private void ConsultarButton_Click(object sender, RoutedEventArgs e)
        {
            var listado = new List <Vendedores>();

            if (CriterioTextBox.Text.Trim().Length > 0)
            {
                switch (FiltroComboBox.SelectedIndex)
                {
                case 0:     //ProductoId
                    listado = VendedoresBLL.GetList(v => v.VendedorId == Utilidades.ToInt(CriterioTextBox.Text));
                    break;

                case 1:     //Nombres
                    listado = VendedoresBLL.GetList(v => v.Nombres.Contains(CriterioTextBox.Text, StringComparison.OrdinalIgnoreCase));
                    break;

                case 2:     //Apellidos
                    listado = VendedoresBLL.GetList(v => v.Apellidos.Contains(CriterioTextBox.Text, StringComparison.OrdinalIgnoreCase));
                    break;

                    /*case 3: //UsuarioId
                     *  listado = VendedoresBLL.GetList(v => v.UsuarioId.Contains(CriterioTextBox.Text, StringComparison.OrdinalIgnoreCase));
                     *  break;*/
                }
            }
            else
            {
                listado = VendedoresBLL.GetList(c => true);
            }

            DatosDataGrid.ItemsSource = null;
            DatosDataGrid.ItemsSource = listado;
        }
コード例 #3
0
        protected void ButtonGuardar_Click(object sender, EventArgs e)
        {
            Vendedores vendedores = new Vendedores();

            Llenar(vendedores);
            VendedoresBLL.Guardar(vendedores);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert(' Se Guardo Correctamente');</script>");
        }
コード例 #4
0
        protected void GuardarButton_Click(object sender, EventArgs e)
        {
            Vendedores vendedores = new Vendedores();

            Llenar(vendedores);
            VendedoresBLL.Guardar(vendedores);
            Utilidades.ShowToastr(this, "Proceso Completado", "Exito", "success");
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Listas = VendedoresBLL.ListarTodo();

                GridViewConsultaVendedores.DataSource = Listas;
                GridViewConsultaVendedores.DataBind();
            }
        }
コード例 #6
0
 public void BuscarVendedores(Vendedores ve)
 {
     if (VendedoresBLL.Buscar(Utilidades.TOINT(IdTextBox.Text)) == null)
     {
         Utilidades.ShowToastr(this, "No Existe", "Danger", "warning");
     }
     else
     {
         VendedoresBLL.Buscar(Utilidades.TOINT(IdTextBox.Text));
     }
 }
コード例 #7
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (VendedorIdTextBox.Text == "")
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Debes Llenar El Campo Disco ID');</script>");
     }
     else
     {
         BuscarVwndedor(VendedoresBLL.Buscar(String(VendedorIdTextBox.Text)));
     }
 }
コード例 #8
0
 protected void BuscarButton_Click(object sender, EventArgs e)
 {
     if (IdTextBox.Text == "")
     {
         base.Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Debes llenar el campo Id para realizar la busqueda!');</script>");
     }
     else
     {
         BuscarVendedores(VendedoresBLL.Buscar(String(IdTextBox.Text)));
     }
 }
コード例 #9
0
 public void BuscarVwndedor(Vendedores v)
 {
     if (VendedoresBLL.Buscar(String(VendedorIdTextBox.Text)) == null)
     {
         base.Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('No Existe');</script>");
     }
     else
     {
         IdTextBox.Text             = v.VendedoresId.ToString();
         NombreVendedorTextBox.Text = v.Nombres;
     }
 }
コード例 #10
0
ファイル: Registro.cs プロジェクト: johang08/PrimerParcial
        private void button3_Click(object sender, EventArgs e)
        {
            errorProvider2.Clear();
            int id;

            int.TryParse(IDnumericUpDown.Text, out id);
            if (VendedoresBLL.Eliminar(id))
            {
                MessageBox.Show("Eliminado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            Limpiar();
            errorProvider2.SetError(IDnumericUpDown, "no se puede eliminar");
        }
 public rVentas()
 {
     InitializeComponent();
     this.DataContext                     = venta;
     VentaIdTextBox.Text                  = "0";
     venta.CostoTotal                     = 0;
     venta.GananciaTotal                  = 0;
     venta.ITBISTotal                     = 0;
     venta.PrecioTotal                    = 0;
     VendedorIdComboBox.ItemsSource       = VendedoresBLL.GetVendedores();
     VendedorIdComboBox.SelectedValuePath = "VendedorId";
     VendedorIdComboBox.DisplayMemberPath = "VendedorId";
 }
コード例 #12
0
        public static IEnumerable <VendedoresVO> GetVendedores(VendedoresVO VendedoresVO)
        {
            var LsCiudades = VendedoresBLL.GetVendedores(VendedoresVO.IdCiudad);

            var listaCiudades = LsCiudades.Tables[0].AsEnumerable().Select(DataRow => new VendedoresVO
            {
                IdCiudad   = DataRow.Field <string>("IdCiudad").ToString(),
                IdVendedor = DataRow.Field <string>("IdVendedor").ToString(),
                IdFactura  = DataRow.Field <string>("IdFacturas").ToString()
            }).ToList();

            return(listaCiudades);
        }
 private void EliminarButton_Click(object sender, RoutedEventArgs e)
 {
     if (VendedoresBLL.Eliminar(Convert.ToInt32(VendedorIdTextBox.Text)))
     {
         Limpiar();
         MessageBox.Show("Vendedor eliminado!", "Exito",
                         MessageBoxButton.OK, MessageBoxImage.Information);
     }
     else
     {
         MessageBox.Show("No fue posible eliminar al Vendedor", "Fallo",
                         MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
コード例 #14
0
        private void button1_Click(object sender, EventArgs e)
        {
            var listado = new List <Vendedores>();

            if (CriteriotextBox.Text.Trim().Length > 0)
            {
                switch (FiltrocomboBox.SelectedIndex)
                {
                case 0:
                    listado = VendedoresBLL.GetList(p => true);
                    break;

                case 1:
                    int id = Convert.ToInt32(CriteriotextBox.Text);
                    listado = VendedoresBLL.GetList(p => p.IDVendedor == id);
                    break;

                case 2:
                    listado = VendedoresBLL.GetList(p => p.Nombre.Contains(CriteriotextBox.Text));
                    break;

                case 3:
                    decimal sueldo = Convert.ToDecimal(CriteriotextBox.Text);
                    listado = VendedoresBLL.GetList(p => p.Sueldo == sueldo);
                    break;

                case 4:
                    decimal retencion = Convert.ToDecimal(CriteriotextBox.Text);
                    listado = VendedoresBLL.GetList(p => p.Retencion == retencion);
                    break;

                case 5:
                    decimal total = Convert.ToDecimal(CriteriotextBox.Text);
                    listado = VendedoresBLL.GetList(p => p.Total == total);
                    break;
                }
                listado = listado.Where(c => c.Fecha >= DesdedateTimePicker.Value.Date && c.Fecha <= HastadateTimePicker.Value.Date).ToList();
            }



            else
            {
                listado = VendedoresBLL.GetList(p => true);
            }
            dataGridView1.DataSource = null;
            dataGridView1.DataSource = listado;
        }
コード例 #15
0
        private void Eliminar_Button_Click(object sender, EventArgs e)
        {
            VendedorErrorProvider.Clear();
            int.TryParse(VendedorIdNumericUpDown.Text, out int id);

            if (!ExisteEnLaBaseDeDatos())
            {
                VendedorErrorProvider.SetError(VendedorIdNumericUpDown, "No se puede eliminar un vendedor que no existe");
                return;
            }
            if (VendedoresBLL.Eliminar(id))
            {
                Limpiar();
                MessageBox.Show("Eliminado");
            }
        }
        private void BuscarButton_Click(object sender, RoutedEventArgs e)
        {
            var vendedores = VendedoresBLL.Buscar(int.Parse(VendedorIdTextBox.Text));

            if (vendedores != null)
            {
                this.vendedores = vendedores;
            }
            else
            {
                this.vendedores = new Entidades.Vendedores();
                MessageBox.Show("El Vendedor no existe", "Fallo",
                                MessageBoxButton.OK, MessageBoxImage.Information);
                Limpiar();
            }

            //Limpiar();
            this.DataContext = this.vendedores;
        }
コード例 #17
0
        private void Buscar_Button_Click(object sender, EventArgs e)
        {
            Vendedor vendedor = new Vendedor();

            int.TryParse(VendedorIdNumericUpDown.Text, out int id);

            vendedor = VendedoresBLL.Buscar(id);

            if (vendedor != null)
            {
                MessageBox.Show("Vendedor Encontrado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                LlenaCampo(vendedor);
            }
            else
            {
                MessageBox.Show("Vendedor no Encontado", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Limpiar();
            }
        }
コード例 #18
0
ファイル: Registro.cs プロジェクト: johang08/PrimerParcial
        private void button4_Click(object sender, EventArgs e)
        {
            errorProvider2.Clear();
            int        id;
            Vendedores vendedores = new Vendedores();

            int.TryParse(IDnumericUpDown.Text, out id);

            vendedores = VendedoresBLL.Buscar(id);

            if (vendedores != null)
            {
                LlenarCampo(vendedores);
                MessageBox.Show("Encotrado");
            }
            else
            {
                MessageBox.Show("No Exite");
            }
        }
コード例 #19
0
 public void BuscarVendedores(Vendedores ve)
 {
     if (VendedoresBLL.Buscar(String(IdTextBox.Text)) == null)
     {
         base.Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('No Existe');</script>");
     }
     else
     {
         NombresTextBox.Text     = Convert.ToString(ve.Nombres);
         DescripcionTextBox.Text = ve.Descripcion;
         MjeInicialTextBox.Text  = ve.MensajeInicial;
         MjeFinalTextBox.Text    = ve.MensajeFinal;
         float PorcientoComision1 = Convert.ToSingle(Pct1TextBox.Text);
         float PorcientoComision2 = Convert.ToSingle(Pct2TextBox.Text);
         float PorcientoComision3 = Convert.ToSingle(Pct3TextBox.Text);
         float PorcientoComision4 = Convert.ToSingle(Pct4TextBox.Text);
         float PorcientoComision5 = Convert.ToSingle(Pct5TextBox.Text);
         float LimiteVentas       = Convert.ToSingle(LimiteVTextBox.Text);
     }
 }
コード例 #20
0
 private void RetencionNumericUpDown_ValueChanged(object sender, EventArgs e)
 {
     {
         if (Validar())
         {
             MessageBox.Show("llenar el campo vacio", "trate de guardar de nuevo",
                             MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         if (SueldoNumericUpDown.Value != 0 && PorcentajeRetencionNumericUpDown.Value != 0)
         {
             RetencionNumericUpDown.Value = VendedoresBLL.CalculoRetencion(SueldoNumericUpDown.Value, PorcentajeRetencionNumericUpDown.Value);
         }
         else
         {
             MessageBox.Show("algun campo no esta lleno correctamente", "trate de nuevo",
                             MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
コード例 #21
0
ファイル: Registro.cs プロジェクト: johang08/PrimerParcial
        private void button2_Click(object sender, EventArgs e)
        {
            errorProvider2.Clear();
            bool       paso = false;
            Vendedores vendedores;
            Contexto   contexto = new Contexto();

            if (!Validar())
            {
                return;
            }
            vendedores = LlenarClase();
            try
            {
                if (IDnumericUpDown.Value == 0)
                {
                    paso = VendedoresBLL.Guardar(vendedores);
                }
                else
                {
                    if (!EstaEnLaBaseDeDatos())
                    {
                        MessageBox.Show("No se puede modificar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    paso = VendedoresBLL.Modificar(vendedores);
                }
                if (paso)
                {
                    MessageBox.Show("Se Guardo Exitosamente", "Imformacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Limpiar();
                }
                else
                {
                    MessageBox.Show("No se Gurdo!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        private void GuardarButton_Click(object sender, RoutedEventArgs e)
        {
            if (!Validar())
            {
                return;
            }

            var paso = VendedoresBLL.Guardar(vendedores);

            if (paso)
            {
                Limpiar();
                MessageBox.Show("Transacción exitosa!", "Exito",
                                MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                MessageBox.Show("Transacción Fallida", "Fallo",
                                MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
コード例 #23
0
        private void BuscarSelecCombo()
        {
            Listas = null;

            if (DropDownListFiltro.SelectedIndex == 0)
            {
                Listas = VendedoresBLL.ListarTodo();
            }
            else if (DropDownListFiltro.SelectedIndex == 1)
            {
                if (TextBoxFiltro.Text == "")
                {
                    base.Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Debe de Insertar la descripcion');</script>");
                }
                else
                {
                    int Busqueda = Utilidades.TOINT(TextBoxFiltro.Text);
                    Listas = VendedoresBLL.GetList(a => a.VendedoresId == Busqueda);
                    GridViewConsultaVendedores.DataSource = Listas;
                    GridViewConsultaVendedores.DataBind();
                }
            }
            else if (DropDownListFiltro.SelectedIndex == 2)
            {
                if (TextBoxFiltro.Text == "")
                {
                    base.Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Debe de Insertar la descripcion');</script>");
                }
                else
                {
                    int Busqueda = Utilidades.TOINT(TextBoxFiltro.Text);
                    Listas = VendedoresBLL.GetList(a => a.VendedoresId == Busqueda);
                    GridViewConsultaVendedores.DataSource = Listas;
                    GridViewConsultaVendedores.DataBind();
                }
            }

            GridViewConsultaVendedores.DataSource = Listas;
            GridViewConsultaVendedores.DataBind();
        }
コード例 #24
0
        private void Guardar_Button_Click(object sender, EventArgs e)
        {
            Vendedor vendedor;
            bool     paso = false;

            if (!Validar())
            {
                return;
            }
            vendedor = LlenaClase();


            if (VendedorIdNumericUpDown.Value != 0)
            {
                paso = VendedoresBLL.Guardar(vendedor);
            }
            else
            {
                if (!ExisteEnLaBaseDeDatos())
                {
                    MessageBox.Show("No se puede modificar un vendedor que no existe", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                paso = VendedoresBLL.Modificar(vendedor);
            }

            if (paso)
            {
                MessageBox.Show("Guardado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Limpiar();
            }
            else
            {
                MessageBox.Show("No se pudo guardar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #25
0
        private bool ExisteEnLaBaseDeDatos()
        {
            Vendedor vendedor = VendedoresBLL.Buscar(id: (int)VendedorIdNumericUpDown.Value);

            return(vendedor != null);
        }
        private bool Existe()
        {
            Vendedores vendedor = VendedoresBLL.Buscar(vendedores.VendedorId);

            return(vendedores != null);
        }
コード例 #27
0
ファイル: Registro.cs プロジェクト: johang08/PrimerParcial
        private bool EstaEnLaBaseDeDatos()
        {
            Vendedores vendedores = VendedoresBLL.Buscar((int)IDnumericUpDown.Value);

            return(vendedores != null);
        }
コード例 #28
0
 protected void LimpiarCampos_Click(object sender, EventArgs e)
 {
     VendedoresBLL.Eliminar(String(SubsidiosIdTextBox.Text));
     Page.ClientScript.RegisterStartupScript(GetType(), "scripts", "<script>alert(' Se Elimino Correctamente');</script>");
 }