private void btnGuardar_Click(object sender, EventArgs e) { modelo.Factura fact = new modelo.Factura(); try { DialogResult dialogo = MessageBox.Show("Decea aser la Devolucion ", "DEVOLUCION", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialogo == DialogResult.Yes) { fact.IdUser = this.idFact; fact.devolucionTotal(); } else { return; } } catch (Exception ex) { Console.WriteLine(ex); } if (fact.Mensaje.Equals("Devolucion correcta")) { MessageBox.Show(fact.Mensaje); lblTitulo.Text = "DEVOLUCION DE FACTURA TOTAL"; controlador.CrudFactura dev = new controlador.CrudFactura(); dev.buscarFactura(1, "n", dataFact); } else { MessageBox.Show(fact.Mensaje); } }
private void BusquedaFact_Load(object sender, EventArgs e) { if (this.accion.Equals(1)) { lblTitulo.Text = "BUSQUEDA DE FACTURA"; controlador.CrudFactura fact = new controlador.CrudFactura(); fact.buscarFactura(1, "n", dataFact); } else { if (this.accion.Equals(3)) { btnGuardar.Visible = false; lblTitulo.Text = "DEVOLUCION DE FACTURA TOTAL"; controlador.CrudFactura fact = new controlador.CrudFactura(); fact.buscarFactura(1, "n", dataFact); } else { if (this.accion.Equals(4) || this.accion.Equals(5)) { btnEli.Visible = true; btnActu.Visible = true; btnEli.Enabled = false; btnActu.Enabled = false; lblTitulo.Text = "MANTENIMIENTO DE FACTURA"; controlador.CrudFactura fact = new controlador.CrudFactura(); fact.buscarFactura(1, "n", dataFact); } else { if (this.accion.Equals(6)) { btnDevDetalle.Enabled = false; btnDevDetalle.Visible = true; lblTitulo.Text = "DEVOLUCION X DETALLE "; controlador.CrudFactura fact = new controlador.CrudFactura(); fact.buscarFactura(1, "n", dataFact); } else { lblTitulo.Text = "BUSQUEDA DE DEVOLUCIONES"; controlador.CrudFactura fact = new controlador.CrudFactura(); fact.buscarFacturaDevolucion(1, "n", dataFact); } } } } }
private void btnBuscar_Click(object sender, EventArgs e) { if (textBox9.Text.Equals("")) { MessageBox.Show("El Campo de Busqueda esta Vacio"); } else { if (this.accion.Equals(1)) { /*BUSQUEDAS DE PRODUCTOS */ controlador.CrudFactura fact = new controlador.CrudFactura(); fact.buscarFactura(2, textBox9.Text, dataFact); } else { if (this.accion.Equals(3)) { controlador.CrudFactura fact = new controlador.CrudFactura(); fact.buscarFactura(2, textBox9.Text, dataFact); } else { if (this.accion.Equals(4) || this.accion.Equals(5) || this.accion.Equals(6)) { btnEli.Visible = true; btnActu.Visible = true; btnEli.Enabled = false; btnActu.Enabled = false; controlador.CrudFactura fact = new controlador.CrudFactura(); fact.buscarFactura(2, textBox9.Text, dataFact); } else { /*BUSQUEDA DE DEVOLUCIONES */ controlador.CrudFactura fact = new controlador.CrudFactura(); fact.buscarFacturaDevolucion(2, textBox9.Text, dataFact); } } } } }
private void btnEli_Click(object sender, EventArgs e) { if (this.accion.Equals(4)) { try { DialogResult dialogo = MessageBox.Show("Dece eliminar Toda La factura", "ELIMINAR", MessageBoxButtons.YesNo, MessageBoxIcon.Stop); if (dialogo == DialogResult.Yes) { modelo.CambioCliente fact = new modelo.CambioCliente(); fact.Idfactura = this.idFact; fact.elimFact(); if (fact.Msg.Equals("Factura eliminada")) { MessageBox.Show(fact.Msg); controlador.CrudFactura fac = new controlador.CrudFactura(); fac.buscarFactura(1, "n", dataFact); } else { MessageBox.Show(fact.Msg); } } else { return; } } catch (Exception ex) { Console.WriteLine(ex); } } }
private void Factura_Load(object sender, EventArgs e) { dataventas.Columns.Add("num", "#"); dataventas.Columns.Add("producto", "Codigo"); dataventas.Columns.Add("producto", "Producto"); dataventas.Columns.Add("precio", "Precio $"); dataventas.Columns.Add("descuento", "Descuento %"); dataventas.Columns.Add("cantidad", "Cantidad"); dataventas.Columns.Add("total", "Total $"); if (idproducto.Count.Equals(0)) { btnGuardar.Enabled = false; } else { int con = 0; if (idproducto.Count <= 10) { btnGuardar.Enabled = true; for (int i = 0; i < idproducto.Count; i++) { con = con + 1; dataventas.Rows.Add(con, Codigo[i], nombreProducto[i], precioVenta[i], descuento[i], cantidad[i], totalproducto[i]); } txtSub.Text = "$ " + this.subTotal; this.Iva = this.subTotal * 0.13; this.Total = this.subTotal + this.Iva; txtIva.Text = "$" + this.Iva; txtTotal.Text = "$ " + this.Total; } else { btnProducto.Enabled = false; for (int i = 0; i < idproducto.Count; i++) { con = con + 1; dataventas.Rows.Add(con, Codigo[i], nombreProducto[i], precioVenta[i], descuento[i], cantidad[i], totalproducto[i]); } txtSub.Text = "$ " + this.subTotal; this.Iva = this.subTotal * 0.13; this.Total = this.subTotal + this.Iva; txtIva.Text = "$" + this.Iva; txtTotal.Text = "$ " + this.Total; MessageBox.Show("Limite de items 10"); } } if (this.tipo.Equals("")) { txttipo.Text = ""; txtFecha.Text = fecha.ToString("dd/MM/yyyy"); txtSub.Text = "$" + this.SubTotal; txtIva.Text = "$" + this.Iva1; txtTotal.Text = "$" + this.Total; btnProducto.Enabled = false; controlador.CrudFactura numero = new controlador.CrudFactura(); numero.maximoFactura(); txtFactura.Text = "No " + numero.Fac; if (numero.Fac.Equals(0)) { txtFactura.Text = "FA1"; this.numeroFact = "FA1"; } else { txtFactura.Text = "FA" + numero.Fac; this.numeroFact = "FA" + numero.Fac; } } else { if (this.tipo.Equals("Natural")) { lblDocumento.Text = "DUI"; btnProducto.Enabled = true; } else { lblDocumento.Text = "# Registro"; btnProducto.Enabled = true; } txtFecha.Text = fecha.ToString("dd/MM/yyyy"); txCodCliente.Text = Convert.ToString(this.idCliente); txtNonbreCliente.Text = this.nombreCliente; txtDocumento.Text = this.documento; txtDireccion.Text = this.Direccion; txtTelefono.Text = this.Telefono; txttipo.Text = this.tipo; txtVendedor.Text = this.nombre; Console.WriteLine("numero de fACTURA" + this.numeroFact); txtFactura.Text = this.numeroFact; } }
private void ActuFactu_Load(object sender, EventArgs e) { if (this.accion.Equals(4) || this.accion.Equals(5)) { lblTitulo.Text = "MANTENIMIENTO DE FACTURA"; //ppfact controlador.CrudFactura fac = new controlador.CrudFactura(); fac.seleccionaPrtoducFact(this.idFact, dataProd); /*para traer el encabezado */ modelo.CambioCliente cambio = new modelo.CambioCliente(); cambio.seleEnfac(this.idFact); if (cambio.Msg.Equals("true")) { txtFactura.Text = cambio.Factura; txtVendedor.Text = cambio.Vendedor; txtFecha.Text = cambio.Fecha; txCodCliente.Text = cambio.CodCliente1.ToString(); txtNonbreCliente.Text = cambio.Cliente; txtDocumento.Text = cambio.Dui; txtDireccion.Text = cambio.Direccion; txtTelefono.Text = cambio.Telefono; txttipo.Text = cambio.NombreTipo; txtSub.Text = cambio.Sub1.ToString(); txtIva.Text = cambio.Iva.ToString(); txtTotal.Text = cambio.Total.ToString(); } else { MessageBox.Show(cambio.Msg); } } else { btnProducto.Visible = false; btnCliente.Visible = false; lblTitulo.Text = "DEVOLUCION X DETALLE"; //ppfact controlador.CrudFactura fac = new controlador.CrudFactura(); fac.seleccionaPrtoducFact(this.idFact, dataProd); /*para traer el encabezado */ modelo.CambioCliente cambio = new modelo.CambioCliente(); cambio.seleEnfac(this.idFact); if (cambio.Msg.Equals("true")) { txtFactura.Text = cambio.Factura; txtVendedor.Text = cambio.Vendedor; txtFecha.Text = cambio.Fecha; txCodCliente.Text = cambio.CodCliente1.ToString(); txtNonbreCliente.Text = cambio.Cliente; txtDocumento.Text = cambio.Dui; txtDireccion.Text = cambio.Direccion; txtTelefono.Text = cambio.Telefono; txttipo.Text = cambio.NombreTipo; txtSub.Text = cambio.Sub1.ToString(); txtIva.Text = cambio.Iva.ToString(); txtTotal.Text = cambio.Total.ToString(); } else { MessageBox.Show(cambio.Msg); } } }