private void AgregarProductosCompraBtn_Click(object sender, EventArgs e) { if (botonCliente == true && botonVendedor == true) { botonAgregar = true; List <Producto> listaProductos = CargaGeneral.CargarProductos(); DGVProductos.DataSource = listaProductos; DGVProductos.Columns[0].HeaderText = "Id del Producto"; DGVProductos.Columns[1].HeaderText = "Nombre del Producto"; DGVProductos.Columns[2].HeaderText = "Cantidad del Producto"; DGVProductos.Columns[3].HeaderText = "Precio del Producto"; DGVProductos.Columns[4].HeaderText = "Estado del Producto"; List <Producto> listaProductosAgregadosCompra = CargaGeneral.AgregarProductoALaCompra (int.Parse(IdProductoAgregarCompraTxt.Text)); DataGridViewProductosDeLaCompra.DataSource = listaProductosAgregadosCompra; sumatoriaTotal += listaProductosAgregadosCompra[0].GetPrecioProducto(); if (ApellidoClienteLbl.Text == "Simpson") { sumatoriaTotal *= 0.87; } PrecioTotalLbl.Text = sumatoriaTotal.ToString(); } else { MessageBox.Show("Por favor ingrese un cliente y un vendedor antes de agregar productos."); } DataGridViewProductosDeLaCompra.Columns[0].HeaderText = "Id del Producto"; DataGridViewProductosDeLaCompra.Columns[1].HeaderText = "Nombre del Producto"; DataGridViewProductosDeLaCompra.Columns[2].HeaderText = "Cantidad del Producto"; DataGridViewProductosDeLaCompra.Columns[3].HeaderText = "Precio del Producto"; DataGridViewProductosDeLaCompra.Columns[4].HeaderText = "Estado del Producto"; }
private void ComprasForm_Load(object sender, EventArgs e) { List <Cliente> listaClientesExistentes = CargaGeneral.CargarClientes(); DGVClientes.DataSource = listaClientesExistentes; DGVClientes.Columns[0].HeaderText = "Direccion"; DGVClientes.Columns[2].HeaderText = "Apellido"; DGVClientes.Columns[3].HeaderText = "Dni"; DGVClientes.Columns[1].HeaderText = "Nombre"; }
private void RealizarCompraForm_Load(object sender, EventArgs e) { List <Producto> listaProductos = CargaGeneral.CargarProductos(); DGVProductos.DataSource = listaProductos; DGVProductos.Columns[0].HeaderText = "Id del Producto"; DGVProductos.Columns[1].HeaderText = "Nombre del Producto"; DGVProductos.Columns[2].HeaderText = "Cantidad del Producto"; DGVProductos.Columns[3].HeaderText = "Precio del Producto"; DGVProductos.Columns[4].HeaderText = "Estado del Producto"; }
private void GralStockForm_Load(object sender, EventArgs e) { List <Producto> listaProductosGral = CargaGeneral.CargarProductos(); DGVGralStock.DataSource = listaProductosGral; DGVGralStock.Columns[0].HeaderText = "Id del Producto"; DGVGralStock.Columns[1].HeaderText = "Nombre del Producto"; DGVGralStock.Columns[2].HeaderText = "Cantidad del Producto"; DGVGralStock.Columns[3].HeaderText = "Precio del Producto"; DGVGralStock.Columns[4].HeaderText = "Estado del Producto"; }
private void AgregarNuevoProductoBtn_Click(object sender, EventArgs e) { if (NuevoProductoCantidadTxt.Text != null && NuevoProductoNombreTxt.Text != null && NuevoProductoPrecioTxt.Text != null) { CargaGeneral.AgregarNuevoProducto(NuevoProductoNombreTxt.Text, int.Parse(NuevoProductoCantidadTxt.Text), double.Parse(NuevoProductoPrecioTxt.Text)); MessageBox.Show("Producto agregado."); } else { MessageBox.Show("Por favor llene los campos necesarios."); } this.Close(); }
private void ConfirmarVendedorBtn_Click(object sender, EventArgs e) { if (DniVendedorTxt.Text != null) { List <Vendedor> vendedorCompras = CargaGeneral.NumeroDeVentasPorEmpleado(int.Parse(DniVendedorTxt.Text)); DGVEmpleados.DataSource = vendedorCompras; DGVEmpleados.Columns[0].HeaderText = "Fecha de la Venta"; DGVEmpleados.Columns[1].HeaderText = "Nombre Vendedor"; DGVEmpleados.Columns[2].HeaderText = "Apellido Vendedor"; DGVEmpleados.Columns[3].HeaderText = "Dni Vendedor"; } else { MessageBox.Show("Por Favor ingrese un dni."); } }
private void ProductosEscasosForm_Load(object sender, EventArgs e) { List <Producto> listaProductosGral = CargaGeneral.CargarProductos(); List <Producto> listaProductosEscasos = new List <Producto>(); for (int i = 0; i < listaProductosGral.Count; i++) { if (listaProductosGral[i].GetCantidadProducto() < 10) { listaProductosEscasos.Add(listaProductosGral[i]); } } DGVGralStock.DataSource = listaProductosEscasos; DGVGralStock.Columns[0].HeaderText = "Id del Producto"; DGVGralStock.Columns[1].HeaderText = "Nombre del Producto"; DGVGralStock.Columns[2].HeaderText = "Cantidad del Producto"; DGVGralStock.Columns[3].HeaderText = "Precio del Producto"; }
private void LogInBtn_Click(object sender, EventArgs e) { List <Vendedor> logInVendedor = CargaGeneral.VerificarVendedor(int.Parse(DniEmpleadoVerificar.Text)); if (DniEmpleadoVerificar.Text != null) { NombreVendedorLbl.Text = logInVendedor[0].GetNombre(); ApellidoVendedorLbl.Text = logInVendedor[0].GetApellido(); if (logInVendedor != null) { Form formPrincipal = new FormPrincipal(); formPrincipal.Show(); } } else { MessageBox.Show("Ingrese el dni de un vendedor existente."); } }
private void VerificarDniClienteBtn_Click(object sender, EventArgs e) { if (DniClienteVerificarTxt.Text != null) { botonCliente = true; List <Cliente> clienteVerificar = CargaGeneral.VerificarCliente( int.Parse(DniClienteVerificarTxt.Text)); NombreClienteLbl.Text = clienteVerificar[0].GetNombre(); ApellidoClienteLbl.Text = clienteVerificar[0].GetApellido(); DniClienteLbl.Text = clienteVerificar[0].GetDni().ToString(); string fileCompras = Path.Combine(Environment.CurrentDirectory, "Some\\Compras.txt"); List <Cliente> clienteCompra = CargaGeneral.VerificarCliente(int.Parse(DniClienteVerificarTxt.Text)); string inicioCompra = "Cliente," + clienteCompra[0].GetNombre() + "," + clienteCompra[0].GetApellido() + "\n"; File.AppendAllText(fileCompras, inicioCompra); } else { MessageBox.Show("Ingrese un Dni."); } }
private void VerificarDniVendedorBtn_Click(object sender, EventArgs e) { if (DniVendedorVerificarTxt.Text != null) { botonVendedor = true; List <Vendedor> vendedorVerificar = CargaGeneral.VerificarVendedor( int.Parse(DniVendedorVerificarTxt.Text)); NombreVendedorLbl.Text = vendedorVerificar[0].GetNombre(); ApellidoVendedorLbl.Text = vendedorVerificar[0].GetApellido(); DniVendedorLbl.Text = vendedorVerificar[0].GetDni().ToString(); string fileCompras = Path.Combine(Environment.CurrentDirectory, "Some\\Compras.txt"); List <Vendedor> vendedorCompra = CargaGeneral.VerificarVendedor (int.Parse(DniVendedorVerificarTxt.Text)); string inicioCompra = "Vendedor," + vendedorCompra[0].GetNombre() + "," + vendedorCompra[0].GetApellido() + ",Fecha," + DateTime.Now.ToString() + "\n"; File.AppendAllText(fileCompras, inicioCompra); } else { MessageBox.Show("Ingrese un Dni."); } }
private void ModificarProductoBtn_Click(object sender, EventArgs e) { if (ModificarProductoIdTxt.Text != null && ModificarProductoCantidadTxt.Text != null && ModificarProductoPrecioTxt.Text != null) { CargaGeneral.ModificarProductoExistente(int.Parse(ModificarProductoIdTxt.Text), int.Parse(ModificarProductoCantidadTxt.Text), double.Parse(ModificarProductoPrecioTxt.Text)); MessageBox.Show("Producto Modificado."); } else { MessageBox.Show("Por favor llene los campos necesarios."); } List <Producto> listaClientesExistentes = CargaGeneral.CargarProductos(); DataGridViewProductosModificar.DataSource = listaClientesExistentes; DataGridViewProductosModificar.Columns[0].HeaderText = "Id del Producto"; DataGridViewProductosModificar.Columns[1].HeaderText = "Nombre del Producto"; DataGridViewProductosModificar.Columns[2].HeaderText = "Cantidad del Producto"; DataGridViewProductosModificar.Columns[3].HeaderText = "Precio del Producto"; DataGridViewProductosModificar.Columns[4].HeaderText = "Estado del Producto";; }
private void AgregarNuevoClienteBtn_Click(object sender, EventArgs e) { if (NuevoClienteApellidoTxt.Text != null && NuevoClienteNombreTxt.Text != null && NuevoClienteDniTxt.Text != null && NuevoClienteDireccionTxt.Text != null) { CargaGeneral.AgregarNuevoCliente(NuevoClienteNombreTxt.Text, NuevoClienteApellidoTxt.Text, int.Parse(NuevoClienteDniTxt.Text), NuevoClienteDireccionTxt.Text); MessageBox.Show("Cliente Agregado."); } else { MessageBox.Show("Por favor llene los campos necesarios."); } List <Cliente> listaClientesExistentes = CargaGeneral.CargarClientes(); DGVClientes.DataSource = listaClientesExistentes; DGVClientes.Columns[0].HeaderText = "Direccion"; DGVClientes.Columns[2].HeaderText = "Apellido"; DGVClientes.Columns[3].HeaderText = "Dni"; DGVClientes.Columns[1].HeaderText = "Nombre"; }