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); } } }