Documentos de Académico
Documentos de Profesional
Documentos de Cultura
PROGRAMACION
FORMULARIO PRINCIPAL
ACCSESO
}
}
}
catch (Exception ex)
{
MessageBox.Show (ex.Message);
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_ListarProveedor : Form
{
public bool w_nuevo;
public bool w_editar;
EBProveedor Proveedor = new EBProveedor ();
Frm_Proveedor Form = new Frm_Proveedor ();
EBTipoProveedor Tipo_Proveedor = new EBTipoProveedor ();
public Frm_ListarProveedor ()
{
InitializeComponent ();
}
private void Frm_ListarProveedor_Load(object sender, EventArgs e)
{
txtIDProveedor.Focus ();
dgvListado.AlternatingRowsDefaultCellStyle.BackColor = Color.FloralWhite;
dgvListado.DefaultCellStyle.BackColor = Color.Beige;
}
private void btnNuevo_Click(object sender, EventArgs e)
{
if (Form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
dgvListado.AutoGenerateColumns = false;
Proveedor.Codigo = txtIDProveedor.Text;
CBProveedores Consultar = new CBProveedores (Proveedor);
dgvListado.DataSource = Consultar;
}
}
dgvListado.AutoGenerateColumns = false;
Proveedor.Codigo = txtIDProveedor.Text;
Proveedor.Nombreproveedor = txtnameProveedor.Text;
Proveedor.Ruc = txtruc.Text;
CBProveedores Consultar = new CBProveedores (Proveedor);
dgvListado.DataSource = Consultar;
}
catch (Exception ex)
{
MessageBox.Show ("Error : " + ex.Message, "Aviso", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
btnEditar.Enabled = true;
btnEliminar.Enabled = true;
btnImprimir.Enabled = true;
}
if ((char.IsNumber(caracter)) | (caracter ==
Convert.ToChar(Strings.ChrW(Convert.ToInt32(Keys.Back)))) | (caracter == Convert.ToChar(".")) &
(txt.Text.Contains (".") == false))
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
f.EBProveedorBindingSource.DataSource = dgvListado.DataSource;
f.reportViewer1.SetDisplayMode (Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
f.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.PageWidth;
f.reportViewer1.RefreshReport ();
f.MdiParent = this.MdiParent;
f.Show ();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
using System.IO;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_Proveedor : Form
{
string Ruta;
string foto = null;
public Frm_Proveedor()
{
InitializeComponent ();
}
try
{
Proveedor.Codigo = txtIDProveedor.Text;
Proveedor.Nombreproveedor = txtnameProveedor.Text;
Proveedor.Direccion = txtDireccion.Text;
Proveedor.Ruc = txtRUC.Text;
Proveedor.Telefono = txtTelefono.Text;
Proveedor.Observacion = txtObservaciones.Text;
Proveedor.Codtipoproveedor = cmdTipoProveedor.SelectedValue.ToString ();
Proveedor.Foto = Ruta;
Proveedor.Estacion = Environment.MachineName.ToString ();
Proveedor.Usuario = Environment.UserName.ToUpper(); ;
if (txtObservaciones.Text == "")
{
Proveedor.Observacion = "Sin Observación";
if (Ruta == "")
{
Ruta = foto = "C:\\Users\\Alumno\\Desktop\\Proyecto Original Compras C# & Oracle
21-10-11\\FOTO SISTEMA\\noexiste.jpg";
Proveedor.Foto = Ruta;
}
Proveedor.Insertar (Proveedor);
DialogResult = DialogResult.OK;
}
else
{
Proveedor.Insertar (Proveedor);
DialogResult = DialogResult.OK;
}
if (txtIDProveedor.Text == "")
{
MessageBox.Show ("Se agregaron los registros exitosamente", "Aviso",
MessageBoxButtons.OK, MessageBoxIcon.Information);
DialogResult = DialogResult.OK;
this.Close ();
}
else
{
MessageBox.Show ("Se Actualizaron los registros exitosamente", "Aviso",
MessageBoxButtons.OK, MessageBoxIcon.Information);
DialogResult = DialogResult.OK;
txtIDProveedor.Text = txtIDProveedor.Text;
txtnameProveedor.Text = Proveedor.Nombreproveedor;
txtDireccion.Text = Proveedor.Direccion;
txtRUC.Text = Proveedor.Ruc;
cmdTipoProveedor.SelectedValue = Proveedor.Codtipoproveedor;
txtTelefono.Text = Proveedor.Telefono;
txtObservaciones.Text = Proveedor.Observacion;
Ruta = Proveedor.Foto;
foto = Ruta;
If (Ruta == "")
{
foto = "C:\\Users\\Alumno\\Desktop\\Proyecto Original Compras C# & Oracle 21-10-
11\\FOTO SISTEMA\\noexiste.jpg";
}
else
{
PCTB_Foto.Image = Image.FromFile (foto);
PCTB_Foto.SizeMode = PictureBoxSizeMode.StretchImage;
PCTB_Foto.Visible = true;
}
}
}
catch (Exception ex)
{
MessageBox.Show ("Error: " + ex.Message, "Aviso", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
MANTENIMIENTO PRODUCTO
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_Listar_Producto : Frm_Plantilla_2
{
public Frm_Listar_Producto()
{
InitializeComponent ();
}
Frm_Producto p = new Frm_Producto ();
EBProducto producto = new EBProducto ();
Frm_Producto Form = new Frm_Producto ();
private void btnNuevo_Click(object sender, EventArgs e)
{
if (p.ShowDialog () == System.Windows.Forms.DialogResult.OK)
{
dgvListado.AutoGenerateColumns = false;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_Producto : Frm_Plantilla_1
{
public Frm_Producto()
{
InitializeComponent ();
}
if (txtObservacion.Text == "")
{
producto.Observacion = "Sin Observación";
producto. Insertar (producto);
DialogResult = DialogResult.OK;
}
else
{
producto. Insertar (producto);
DialogResult = DialogResult.OK;
}
if (txtCodProducto.Text == "")
{
MessageBox.Show ("Se agregaron los registros exitosamente", "Aviso",
MessageBoxButtons.OK, MessageBoxIcon.Information);
DialogResult = DialogResult.OK;
this.Close ();
}
else
{
MessageBox.Show ("Se Actualizaron los registros exitosamente", "Aviso",
MessageBoxButtons.OK, MessageBoxIcon.Information);
DialogResult = DialogResult.OK;
this.Close ();
}
}
catch (Exception ex)
{
MessageBox.Show ("Error : " + ex.Message, "Aviso", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
MANTENIMIENTO DOCUMENTO
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_ListarDocumento : Frm_Plantilla_2
{
public Frm_ListarDocumento()
{
InitializeComponent ();
}
Frm_Documento docum = new Frm_Documento ();
EBDocumento Documento = new EBDocumento ();
if (docum.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
dgvListado.AutoGenerateColumns = false;
Documento.Codigo = txtIDProveedor.Text;
CBDocumento Consultar = new CBDocumento (Documento);
dgvListado.DataSource = Consultar;
} docum.txtNomDocumento.Focus ();
}
}
}
catch (Exception ex)
{
MessageBox.Show ("Error: " + ex.Message, "Aviso", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
if ((char.IsNumber(caracter)) | (caracter ==
Convert.ToChar(Strings.ChrW(Convert.ToInt32(Keys.Back)))) | (caracter ==
Convert.ToChar(".")) & (txt.Text.Contains (".") == false))
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_Documento : Frm_Plantilla_1
{
public Frm_Documento()
{
InitializeComponent ();
}
EBDocumento Documento = new EBDocumento ();
private void btnGrabar_Click(object sender, EventArgs e)
{
try
{
Documento.Codigo = txtCodDocumento.Text;
Documento.Tipodocumento = txtNomDocumento.Text;
if (txtCodDocumento.Text == "")
MANTENIMIENTO CATEGORIA
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
if ((char.IsNumber(caracter)) | (caracter ==
Convert.ToChar(Strings.ChrW(Convert.ToInt32(Keys.Back)))) | (caracter == Convert.ToChar(".")) &
(txt.Text.Contains (".") == false))
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_Categoria : Frm_Plantilla_1
{
public Frm_Categoria()
{
InitializeComponent ();
}
EBCategoria Categoria = new EBCategoria ();
private void btnGrabar_Click(object sender, EventArgs e)
{
try
{
Categoria.Codigo = txtCodCategoria.Text;
Categoria.Nombrecategoria = txtNomCategoria.Text;
Categoria.Estacion = Environment.MachineName.ToString ();
Categoria.Usuario = Environment.UserName.ToUpper (); ;
if (txtCodCategoria.Text == "")
{
Categoria.Insertar (Categoria);
MessageBox.Show ("Se agregaron los registros exitosamente", "Aviso",
MessageBoxButtons.OK, MessageBoxIcon.Information);
DialogResult = DialogResult.OK;
this.Close ();
}
else
{
Categoria.Insertar (Categoria);
MessageBox.Show ("Se Actualizaron los registros exitosamente", "Aviso",
MessageBoxButtons.OK, MessageBoxIcon.Information);
DialogResult = DialogResult.OK;
this.Close();
}
}
catch (Exception ex)
{
MessageBox.Show ("Error : " + ex.Message, "Aviso", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
MANTENIMIENTO MONEDA
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_ListarMoneda : Frm_Plantilla_2
{
public Frm_ListarMoneda()
{
InitializeComponent ();
}
Frm_Moneda Form = new Frm_Moneda ();
EBMoneda Moneda = new EBMoneda ();
private void btnNuevo_Click(object sender, EventArgs e)
{
if (Form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
Moneda.Codigo = dgvListado.Rows
[dgvListado.CurrentCell.RowIndex].Cells [0].Value.ToString ();
Moneda.Codigo = txtIDProveedor.Text;
Moneda.Eliminar (Moneda);
MessageBox.Show ("Se Eliminados con éxito el registro...!",
"Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
CBMoneda Consultar = new CBMoneda (Moneda);
dgvListado.DataSource = Consultar;
}
else
{
MessageBox.Show ("Proceso de Eliminación Cancelado...!",
"Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception ex)
{
MessageBox.Show ("Error: " + ex.Message, "Aviso",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_Moneda : Frm_Plantilla_1
{
public Frm_Moneda()
{
InitializeComponent ();
}
EBMoneda Moneda = new EBMoneda ();
private void btnGrabar_Click(object sender, EventArgs e)
{
try
TRANSACCIÓN COMPRAS
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
using System.IO;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_Compra1 : Form
{
private CBDetalleCompra DetalleCompra = new CBDetalleCompra();
EBCompra Compra = new EBCompra();
public bool w_nuevo;
public bool w_editar;
string Ruta;
string foto = null;
EBProveedor Proveedor = new EBProveedor();
public Frm_Compra1()
{
InitializeComponent ();
}
private void HabiBot(bool A)
{
btnSalir.Enabled = A;
}
private void HabiCtrl(bool B)
{
btnGrabar.Enabled = B;
btnCancelar.Enabled = B;
}
private void Caja(bool a)
{
txtserie.Enabled = a;
txtNumeroDocumento.Enabled = a;
txtGuiaRem.Enabled = a;
try
{
for (int i = 0; i <= Dgv.RowCount - 1; i++)
{
total1 = Conversion.Val(total1) +
Conversion.Val(Conversion.Str(Dgv[total.ToLower(), i].Value));
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return total1;
}
private double Sumar2(string subTotal, DataGridView Dgv)
{
double total2 = 0;
try
{
for (int i = 0; i <= Dgv.RowCount - 1; i++)
{
total2 = Conversion.Val(total2) +
Conversion.Val(Conversion.Str(Dgv[subTotal.ToLower(), i].Value));
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return total3;
}
txtproveedor.Focus ();
Caja (false);
HabiBot (true);
HabiCtrl (false);
btnNuevo.Focus ();
this.txtDeudaActual.Text = this.txtTotalGeneral.Text;
this.txtDeudaPendiente.Text = this.txtDeudaActual.Text;
this.btnNuevo.Focus ();
Pry_Libreria_SistemaCaf.Entidades. EBMoneda Moneda = new
Pry_Libreria_SistemaCaf.Entidades. EBMoneda ();
CmbMoneda.DataSource = Moneda.Listar ();
CmbMoneda.DisplayMember = "tipomoneda";
CmbMoneda.ValueMember = "codmoneda";
Pry_Libreria_SistemaCaf.Entidades. EBDocumento Documento = new
Pry_Libreria_SistemaCaf.Entidades. EBDocumento ();
CmbDocumento.DataSource = Documento.Listar ();
CmbDocumento.DisplayMember = "tipodocumento";
CmbDocumento.ValueMember = "coddocumento";
EBCompra Compra1 = new EBCompra ();
try
{
Compra1 = Compra1.ConsultarAll(txtCodigoCompras1.Text);
if ((Compra1 != null))
{
txtCodigoCompras1.Text = Compra1.codcompra;
txtIDProveedor.Text = Compra1.codproveedor;
txtserie.Text = Compra1.serie;
txtNumeroDocumento.Text = Compra1.numerodocumento;
CmbDocumento.SelectedValue = Compra1.TIPODOCUMENTO;
txtGuiaRem.Text = Compra1.guiaremision;
txtFormaPago.Text = Compra1.formapago;
CmbMoneda.SelectedValue = Compra1.TIPOMONEDA;
dtmFemision.Text = (Compra1.fechaemision).ToString();
}
catch (Exception ex)
{
MessageBox.Show("Error : " + ex.Message, "Aviso", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
private void btnEditar_Click(object sender, EventArgs e)
{
w_editar = true;
Caja(true);
txtproveedor.Focus();
btnIngresarDetalle.Enabled = false;
btnCancelar.Enabled = true;
btnGrabar.Enabled = true;
btnEditar.Enabled = false;
btnNuevo.Enabled = false;
dgvlistado.Enabled = true;
btnEliminar.Enabled = false;
btnSalir.Enabled = false;
btnProveedor.Focus();
}
private void btnCancelar_Click(object sender, EventArgs e)
{
try
{
if (txtCodigoCompras1.Text == "") {
Caja(false);
limpiarcajas();
HabiBot(true);
btnGrabar.Enabled = false;
btnCancelar.Enabled = false;
btnNuevo.Enabled = true;
BtnEliminarDetalle.Enabled = false;
txtCodigoCompras1.Text = "";
btnNuevo.Focus();
}
else
{
MessageBox.Show("Operacion en Proceso...!", "Aviso",
MessageBoxButtons.OK, MessageBoxIcon.Information);
btnGrabar.Enabled = true;
btnCancelar.Enabled = true;
btnNuevo.Enabled = false;
btnProveedor.Focus();
}
} else {
Caja(false);
btnEditar.Enabled = true;
btnEliminar.Enabled = true;
btnNuevo.Enabled = false;
btnGrabar.Enabled = false;
btnCancelar.Enabled = false;
btnSalir.Enabled = true;
dgvlistado.Enabled = false;
}
else
{
MessageBox.Show ("Operacion en Proceso...!", "Aviso",
MessageBoxButtons.OK, MessageBoxIcon.Information);
btnProveedor.Focus ();
}
}
}
catch (Exception ex)
{
MessageBox.Show (ex.Message);
}
w_nuevo = false;
w_editar = false;
}
private void btnSalir_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnIngresarDetalle_Click(object sender, EventArgs e)
{
Frm_InsertarCompra Form = new Frm_InsertarCompra();
Form.ShowDialog();
EBDetalleCompra Itemdetalle = new EBDetalleCompra();
dgvListado.AutoGenerateColumns = false;
Itemdetalle.Codigo = Form.txtIDProducto.Text;
Itemdetalle.Unidad = Form.txtUnidad.Text;
Itemdetalle.Descripcion = Form.txtDescripcion.Text;
Itemdetalle.Cantidad = Convert.ToDouble(Form.txtCantidad.Text);
Itemdetalle.Precio_sigv = Convert.ToDouble(Form.txtPUSIGV.Text);
Itemdetalle.Precio_cigv = Convert.ToDouble(Form.txtPUCIGV.Text);
Itemdetalle.Valor_venta = Convert.ToDouble(Form.txtvalorVenta.Text);
Itemdetalle.Igv = Convert.ToDouble(Form.txtIgv.Text);
Itemdetalle.Importe = Convert.ToDouble(Form.txtImporte.Text);
Itemdetalle.Observacion = Form.txtobservacion.Text;
dgvlistado.DataSource = null;
DetalleCompra.AgregarItem(Itemdetalle);
dgvlistado.DataSource = DetalleCompra;
dgvlistado.Refresh();
txtTotalGeneral.Text = (Sumar1("Importe", dgvlistado)).ToString();
txtSubTotal.Text = (Sumar2("Valor_Venta", dgvlistado)).ToString();
txtIgv.Text = (Sumar3("IGV", dgvlistado)).ToString();
txtPago.Text = "0.00";
txtDeudaPendiente.Text = "0.00";
this.txtDeudaActual.Text = this.txtTotalGeneral.Text;
Form.btnProducto.Focus();
if (((e.KeyChar)) == 13)
{
try
{
txtNumeroDocumento.Text =
long.Parse(txtNumeroDocumento.Text).ToString("0000000000");
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message);
}
CmbDocumento.Focus();
}
}
private void txtGuiaRem_KeyPress(object sender, KeyPressEventArgs e)
{
if (((e.KeyChar)) == 13)
{
try
{
txtGuiaRem.Text = txtGuiaRem.Text.ToString();
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message);
}
txtFormaPago.Focus();
}
}
private void txtFormaPago_KeyPress(object sender, KeyPressEventArgs e)
{
if (((e.KeyChar)) == 13)
{
try
{
}
private void CmbMoneda_KeyPress(object sender, KeyPressEventArgs e)
{
if (((e.KeyChar)) == 13)
{
try
{
CmbMoneda.Text = CmbMoneda.Text.ToString();
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message);
}
dtmFemision.Focus();
}
}
private void BtnEliminarDetalle_Click(object sender, EventArgs e)
{
try
{
f.reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
f.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.PageWidth;
f.reportViewer1.RefreshReport();
f.MdiParent = this.MdiParent;
f.Show();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Linq;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_Lista_ComprasRegistradas : Form
{
EBCompra Compra1 = new EBCompra();
try
{
for (int i = 0; i <= Dgv.RowCount - 1; i++)
{
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return total3;
}
public Frm_Lista_ComprasRegistradas()
{
InitializeComponent();
}
private void Frm_Lista_ComprasRegistradas_Load(object sender, EventArgs
e)
{
EBCompra Compra = new EBCompra();
dgvlistado.DataSource = Compra.Listar();
Pry_Libreria_SistemaCaf.Entidades. EBMoneda Moneda = new
Pry_Libreria_SistemaCaf.Entidades. EBMoneda();
CmbMoneda.DataSource = Moneda.Listar();
CmbMoneda.DisplayMember = "tipomoneda";
CmbMoneda.ValueMember = "codmoneda";
Pry_Libreria_SistemaCaf.Entidades. EBDocumento Documento = new
Pry_Libreria_SistemaCaf.Entidades. EBDocumento();
CmbDocumento.DataSource = Documento.Listar();
CmbDocumento.DisplayMember = "tipodocumento";
CmbDocumento.ValueMember = "coddocumento";
this.dgvlistado.DefaultCellStyle.SelectionForeColor = Color.Yellow;
this.dgvlistado.DefaultCellStyle.SelectionBackColor = Color.Black;
this.dgvlistado.DefaultCellStyle.ForeColor = Color.Blue;
this.dgvlistado.DefaultCellStyle.BackColor = Color.Beige;
txtSubTotal.Text = (Sumar1("subtotal", dgvlistado)).ToString();
txtTotalIgv.Text = (Sumar2("igv", dgvlistado)).ToString();
txtTotal.Text = (Sumar3("totalgeneral", dgvlistado)).ToString();
dgvlistado.Columns[08].DefaultCellStyle.BackColor = Color.AliceBlue;
dgvlistado.Columns[09].DefaultCellStyle.BackColor = Color.MistyRose;
dgvlistado.Columns[10].DefaultCellStyle.BackColor = Color.Thistle;
CmbDocumento.SelectedValue = "";
CmbMoneda.SelectedValue = "";
}
Form.MdiParent = this.MdiParent;
Form.Show ();
}
}
}
REGISTRÓ DETALLE COMPRA
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
if ((Strings.Asc(e.KeyChar)) == 13)
{
txtPUSIGV.Text = Strings.Format(Conversion.Val(y / x), "0.00");
if (txtvalorVenta.Text == "")
{
txtImporte.Text = "";
txtIgv.Text = "0.00";
}
txtIgv.Text = Strings.Format(Conversion.Val(Conversion.Val(txtvalorVenta.Text) *
0.18), "0.00");
txtImporte.Text = Strings.Format(Conversion.Val(txtvalorVenta.Text) +
Conversion.Val(txtIgv.Text), "0.00");
txtPUCIGV.Text = Strings.Format(Conversion.Val(Conversion.Val(txtImporte.Text) / x),
"0.00");
if (txtCantidad.Text == "0.00") { txtPUSIGV.Text = "0.00"; txtPUCIGV.Text = "0.00";
txtCantidad.Text = "0.00"; txtvalorVenta.Text = "0.00"; }
txtImporte.Focus();
}
}
if ((Strings.Asc(e.KeyChar)) == 13)
{
txtvalorVenta.Text = Strings.Format(Conversion.Val(Conversion.Val(txtImporte.Text) /
1.18), "0.00");
txtPUSIGV.Text = Strings.Format(Conversion.Val(Conversion.Val(txtvalorVenta.Text) /
x), "0.00");
txtPUCIGV.Text = Strings.Format(Conversion.Val(Conversion.Val(txtImporte.Text) / x),
"0.00");
txtIgv.Text = Strings.Format(Conversion.Val(Conversion.Val(txtvalorVenta.Text) *
0.18), "0.00");
if (txtCantidad.Text == "0.00") { txtPUSIGV.Text = "0.00"; txtPUCIGV.Text = "0.00";
txtCantidad.Text = "0.00"; }
btnAgregarRecibo.Focus();
}
}
if ((char.IsNumber(caracter)) | (caracter ==
Convert.ToChar(Strings.ChrW(Convert.ToInt32(Keys.Back)))) | (caracter ==
Convert.ToChar(".")) & (txt.Text.Contains(".") == false))
{
e.Handled = false;
}
else
{
e.Handled = true;
}
if ((Strings.Asc(e.KeyChar)) == 13)
{
txtvalorVenta.Focus();
}
}
private void limpiarcajas()
{
txtUnidad.Text = "";
txtDescripcion.Text = "";
txtobservacion.Text = "";
txtCantidad.Text = "0.00";
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf.Colecciones;
namespace Pry_Win_SistemaCaf
{
public partial class Frm_Compra_ReporteGeneral : Form
ENTIDADES / COLECCIONES
ENTIDADES
PROVEEDORES
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
using System.Data;
using System.ComponentModel;
using Pry_Libreria_SistemaCaf.Entidades;
using Pry_Libreria_SistemaCaf;
namespace Pry_Libreria_SistemaCaf.Entidades
{
public class EBProveedor
{
#region Propiedades
#endregion
#region Metodos
public void Insertar(EBProveedor Proveedor)
{
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos(Conexion);
Execute.EjecutaStoreOut("SYSTEMCOMPRASGENERAL.SETPROVEEDORES",
Proveedor.Codigo,
Proveedor.Nombreproveedor,
Proveedor.Direccion,
Proveedor.Ruc,
Proveedor.Telefono,
Proveedor.Observacion,
Proveedor.Codtipoproveedor,
Proveedor.Foto,
Proveedor.Usuario,
Proveedor.Estacion
);
}
#endregion
#region Metodos
}
else
{
dr.Close();
return new EBProveedor();
}
}
#endregion
#region Metodos
public void Eliminar(EBProveedor Proveedor)
{
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos(Conexion);
Execute.EjecutaStoreOut("SYSTEMCOMPRASGENERAL.DELPROVEEDORES",
Proveedor.Codigo,Proveedor.Usuario,Proveedor.Estacion);
}
#endregion
#region Metodos
public DataTable ListarGenerar()
{
DataSet dstresultado = new DataSet();
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos(Conexion);
dstresultado =
Execute.ExecuteStoreDataSet("SYSTEMCOMPRASGENERAL.GETPROVEEDORES_GENERAL",
"");
return dstresultado.Tables[0];
}
#endregion
#region Metodos
public DataTable ListarGeneraR_TipoProveedor(string codTipoProveedor)
{
DataSet dstresultado = new DataSet();
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos(Conexion);
dstresultado =
Execute.ExecuteStoreDataSet("SYSTEMGENERAL.GETPROVEEDORES_GENERALTIPOPRO",
codTipoProveedor, "");
return dstresultado.Tables[0];
}
#endregion
}
}
PRODUCTO
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
using System.Data;
using System.ComponentModel;
using Pry_Libreria_SistemaCaf.Entidades;
using System.Data.OracleClient;
using Pry_Libreria_SistemaCaf;
using DBConexionOracle;
namespace Pry_Libreria_SistemaCaf.Entidades
{
public class EBProducto
{
string Conexion = "Data Source=xe;Persist Security Info=True;User
ID=SYSTEMCOMPRASGENERAL;Password=davila;Unicode=True";
#region Propiedades
#endregion
#region Metodos
public void Insertar(EBProducto Producto)
{
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos(Conexion);
Execute.EjecutaStoreOut("SYSTEMCOMPRASGENERAL.SETPRODUCTO", Producto.Codigo,
Producto.Nombreprooducto,
Producto.Unidad,
Producto.Observacion,
Producto.Codcategoria,
Producto.Usuario,
Producto.Estacion);
}
#endregion
#region Metodos
public EBProducto ConsultarAll(string codigo)
{
DBConexionOracle.DBConexionOracle db = new DBConexionOracle.DBConexionOracle();
DataSet ds = new DataSet();
OracleParameter p = new OracleParameter("pCursor", OracleType.Cursor); p.Direction =
ParameterDirection.Output;
db.AddParameter(p); db.AddParameter("pcodproducto", codigo);
OracleDataReader dr =
(OracleDataReader)db.ExecuteReader("SYSTEMCOMPRASGENERAL.GETPRODUCTO_1");
if (dr.HasRows)
{
EBProducto ObjProducto = new EBProducto();
while (dr.Read())
{
ObjProducto.Codigo = dr.GetString(dr.GetOrdinal("codproducto"));
ObjProducto.Nombreprooducto = dr.GetString(dr.GetOrdinal("nombreprooducto"));
ObjProducto.Unidad = dr.GetString(dr.GetOrdinal("unidad"));
ObjProducto.Observacion = dr.GetString(dr.GetOrdinal("observacion"));
ObjProducto.Codcategoria = dr.GetString(dr.GetOrdinal("CODCATEGORIA"));
}
dr.Close();
return ObjProducto;
}
else
{
dr.Close();
return new EBProducto();
}
}
#endregion
#region Metodos
public void Eliminar(EBProducto Producto)
{
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos(Conexion);
#region Metodos
public DataTable Listar()
{
DataSet dstresultado = new DataSet();
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos(Conexion);
dstresultado =
Execute.ExecuteStoreDataSet("SYSTEMCOMPRASGENERAL.GETPRODUCTO_1", "");
return dstresultado.Tables[0];
}
#endregion
}
}
DOCUMENTO
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
using System.Data;
using System.ComponentModel;
using Pry_Libreria_SistemaCaf.Entidades;
using System.Data.OracleClient;
using Pry_Libreria_SistemaCaf;
using DBConexionOracle;
namespace Pry_Libreria_SistemaCaf.Entidades
{
public class EBDocumento
{
string Conexion = "Data Source=xe;Persist Security Info=True;User
ID=SYSTEMCOMPRASGENERAL;Password=davila;Unicode=True";
string pcoddocumento = "";
string ptipodocumento = "";
#region Propiedades
CATEGORIA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
using System.Data;
using System.ComponentModel;
using Pry_Libreria_SistemaCaf.Entidades;
using System.Data.OracleClient;
using Pry_Libreria_SistemaCaf;
using DBConexionOracle;
namespace Pry_Libreria_SistemaCaf.Entidades
{
public class EBCategoria
{
string Conexion = "Data Source=xe;Persist Security Info=True;User
ID=SYSTEMCOMPRASGENERAL;Password=davila;Unicode=True";
string pcodcategoria = "";
string pnombrecategoria = "";
string vusuario = "";
string vEstacion = "";
#region Propiedades
#region Metodos
public DataTable Listar()
{
DataSet dstresultado = new DataSet();
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos(Conexion);
dstresultado =
Execute.ExecuteStoreDataSet("SYSTEMCOMPRASGENERAL.GETCATEGORIAACTIVO", "");
return dstresultado.Tables[0];
}
#endregion
}
}
MONEDA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
using System.Data;
using System.ComponentModel;
using Pry_Libreria_SistemaCaf.Entidades;
using System.Data.OracleClient;
using Pry_Libreria_SistemaCaf;
using DBConexionOracle;
namespace Pry_Libreria_SistemaCaf.Entidades
{
public class EBMoneda
{
string Conexion = "Data Source=xe;Persist Security Info=True;User
ID=SYSTEMCOMPRASGENERAL;Password=davila;Unicode=True";
string pcodmoneda = "";
string ptipomoneda = "";
#region Propiedades
#endregion
#region Metodo
public void Insertar(EBMoneda Moneda)
{
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos(Conexion);
Execute.EjecutaStoreOut("SYSTEMCOMPRASGENERAL.SETMONEDA", Moneda.Codigo,
Moneda.Tipomoneda
);
}
#endregion
#region Metodos
public void Eliminar(EBMoneda Moneda)
{
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos(Conexion);
Execute.EjecutaStoreOut("SYSTEMCOMPRASGENERAL.DELMONEDA", Moneda.Codigo);
}
#endregion
public DataTable Listar()
{
DataSet dstresultado = new DataSet();
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos(Conexion);
dstresultado =
Execute.ExecuteStoreDataSet("SYSTEMCOMPRASGENERAL.GETMONEDA_1", "");
return dstresultado.Tables[0];
}
}
}
TRANSACCIÓN COMPRAS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
using System.Data;
using System.ComponentModel;
using Pry_Libreria_SistemaCaf.Entidades;
using System.Data.OracleClient;
using Pry_Libreria_SistemaCaf;
using DBConexionOracle;
namespace Pry_Libreria_SistemaCaf.Entidades
{
public class EBCompra
{
}
else
{
dr.Close ();
return new EBCompra();
}
}
public void Eliminar(EBCompra Compra)
{
CapaDatos.Exe.Call_datos Execute = new CapaDatos.Exe.Call_datos (Conexion);
Execute.EjecutaStoreOut ("SYSTEMCOMPRASGENERAL.DELREGISTRO_COMPRAS",
Compra.codcompra, Compra.Usuario);
}
#endregion
}
}
#region Propiedades
public string Codigo
{
get { return string.IsNullOrEmpty(vCodigo) ? "" : vCodigo.Trim(); }
set { vCodigo = value; }
}
public Double Cantidad
{
get { return vcantidad; }
set { vcantidad = value; }
}
public Double Precio_sigv
{
get { return vprecio_sigv; }
set { vprecio_sigv = value; }
}
public Double Precio_cigv
{
get { return vprecio_cigv; }
set { vprecio_cigv = value; }
}
public Double Valor_venta
{
}
}
COLECCIONES
PROVEEDORES
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
using System.Data;
Registros = Ds.Tables[0].Rows;
foreach (DataRow registro in Registros)
{
EBProveedor Proveedores = new EBProveedor();
Proveedores.Codigo = registro["codproveedor"].ToString();
Proveedores.Nombreproveedor = registro["nombreproveedor"].ToString();
Proveedores.Direccion = registro["direccion"].ToString();
Proveedores.Ruc = registro["ruc"].ToString();
Proveedores.Telefono = registro["telefono"].ToString();
Proveedores.Observacion = registro["observacion"].ToString();
Proveedores.Codtipoproveedor = registro["NOMBRETIPOPROVEEDOR"].ToString();
List.Add(Proveedores);
}
}
}
catch (Exception)
{
throw;
}
}
#endregion
}
}
PRODUCTO
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
using System.Data;
using System.ComponentModel;
using Pry_Libreria_SistemaCaf.Entidades;
Registros = Ds.Tables[0].Rows;
foreach (DataRow registro in Registros)
{
EBProducto Producto = new EBProducto();
Producto.Codigo = registro["codproducto"].ToString();
Producto.Nombreprooducto =
registro["nombreprooducto"].ToString();
Producto.Unidad = registro["unidad"].ToString();
Producto.Observacion =
registro["observacion"].ToString();
Producto.Codcategoria =
registro["NOMBRECATEGORIA"].ToString();
List.Add(Producto);
}
}
}
catch (Exception)
{
throw;
}
}
#endregion
}
}
CATEGORIA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
namespace Pry_Libreria_SistemaCaf.Colecciones
{
public class CBCategoria: CollectionBase
{
string Conexion = "Data Source=xe;Persist Security Info=True;User
ID=SYSTEMCOMPRASGENERAL;Password=davila;Unicode=True";
private DataRowCollection Registros = null;
#region Constuctores
public CBCategoria(EBCategoria FiltrosCategoria)
{
this.Buscar(FiltrosCategoria);
}
#endregion
#region Métodos
public void Buscar(EBCategoria Filtros)
{
try
{
CapaDatos.Exe.Call_datos Execute = new
CapaDatos.Exe.Call_datos(Conexion);
DataSet Ds =
Execute.ExecuteStoreDataSet("SYSTEMCOMPRASGENERAL.GETCATEGORIA", Filtros.Codigo,
Filtros.Nombrecategoria,"");
List.Clear();
if (Ds.Tables[0].Rows.Count > 0)
{
Registros = Ds.Tables[0].Rows;
foreach (DataRow registro in Registros)
{
EBCategoria Categoria = new EBCategoria();
Categoria.Codigo = registro["codcategoria"].ToString();
Categoria.Nombrecategoria =
registro["nombrecategoria"].ToString();
List.Add(Categoria);
}
}
}
catch (Exception)
{
throw;
}
}
#endregion
}
}
DOCUMENTO
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
using System.Data;
using System.ComponentModel;
using Pry_Libreria_SistemaCaf.Entidades;
namespace Pry_Libreria_SistemaCaf.Colecciones
{
public class CBDocumento : CollectionBase
{
string Conexion = "Data Source=xe;Persist Security Info=True;User
ID=SYSTEMCOMPRASGENERAL;Password=davila;Unicode=True";
private DataRowCollection Registros = null;
#region Constuctores
public CBDocumento(EBDocumento FiltrosDocumento)
{
this.Buscar(FiltrosDocumento);
}
#endregion
#region Métodos
public void Buscar(EBDocumento Filtros)
{
try
{
CapaDatos.Exe.Call_datos Execute = new
CapaDatos.Exe.Call_datos(Conexion);
DataSet Ds =
Execute.ExecuteStoreDataSet("SYSTEMCOMPRASGENERAL.GETTIPODOCUMENTO",
Filtros.Codigo,Filtros.Tipodocumento, "");
List.Clear();
if (Ds.Tables[0].Rows.Count > 0)
{
Registros = Ds.Tables[0].Rows;
foreach (DataRow registro in Registros)
{
EBDocumento Documento = new EBDocumento();
Documento.Codigo = registro["coddocumento"].ToString();
Documento.Tipodocumento =
registro["tipodocumento"].ToString();
List.Add(Documento);
}
}
}
catch (Exception)
{
throw;
}
}
#endregion
}
}
MONEDA
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
using System.Data;
using System.ComponentModel;
using Pry_Libreria_SistemaCaf.Entidades;
namespace Pry_Libreria_SistemaCaf.Colecciones
{
public class CBMoneda : CollectionBase
Registros = Ds.Tables[0].Rows;
foreach (DataRow registro in Registros)
{
EBMoneda Moneda = new EBMoneda();
Moneda.Codigo = registro["codmoneda"].ToString();
Moneda.Tipomoneda = registro["tipomoneda"].ToString();
List.Add(Moneda);
}
}
}
catch (Exception)
{
throw;
}
}
#endregion
}
}
TRANSACCIÓN COMPRAS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CapaDatos.Exe;
using System.Data;
using System.ComponentModel;
using Pry_Libreria_SistemaCaf.Entidades;
namespace Pry_Libreria_SistemaCaf.Colecciones
{
public class CBCompras : CollectionBase
{
string Conexion = "Data Source=xe;Persist Security Info=True;User
ID=SYSTEMCOMPRASGENERAL;Password=davila;Unicode=True";
private DataRowCollection Registros = null;
#region Constuctores
Registros = Ds.Tables[0].Rows;
foreach (DataRow registro in Registros)
{
EBCompra Compra = new EBCompra();
Compra.numerodocumento = registro
["numerodocumento"].ToString ();
List.Add (Compra);
}
}
}
catch (Exception)
{
throw;
}
}
#endregion
}
}
DETALLE COMPRAS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Data.OracleClient;
using CapaDatos.Exe;
using System.Data;
using System.ComponentModel;
using Pry_Libreria_SistemaCaf.Entidades;
namespace Pry_Libreria_SistemaCaf.Entidades
{
public class CBDetalleCompra : CollectionBase
{
string Conexion = "Data Source=xe;Persist Security Info=True;User
ID=SYSTEMCOMPRASGENERAL;Password=davila;Unicode=True";
public void AgregarItem (EBDetalleCompra Objeto)
{
try
{
List.Add (Objeto);
}
catch (Exception)
{
throw;
}
}
public void EliminarItem (EBDetalleCompra Objeto)
{
try
{
List.Remove (Objeto);
}
catch (Exception)
{
throw;
}
INGRESANDO AL SISTEMA
Luego “Ejecutable”
Barra de Título. – En esta parte del formulario se hace mención el nombre del sistema.
Barra de Menú. – Aquí se podrá tener acceso a todo el sistema mediante una secuencia de
proceso.
FORMULARIO DE ACCCESO
Nº
MESES ACCIÓN DETALLADA USUARIO TIEMPO
Cada
3 Mantenimiento preventivo Programador
Mes
METODOLOGIA
ANÁLISIS:
Estudio de Prefactibilidad.
Recopilación de información mediante entrevistas y taller
grupal.
Metodología RUP, utilizando el lenguaje de modelado UML.
Herramienta utilizada fue el Rational Rose Enterprise 2003.
Tecnología orientada a objetos en base capas.
DISEÑO:
Metodología UML.
Herramienta erwin
La técnica utilizada es modelado base de datos relacional
PROCEDIMIENTOS DE TRABAJO