private void frmActualizarUsuario_Load(object sender, EventArgs e) { Usuario nUsuario = ManejoUsuario.getById(frmBuscarUsuario.PKUSU); txtEmailAgregarUsuario.Text = nUsuario.iEmpleadoUsuario.ToString(); pass = nUsuario.sPassword; }
private void btbAceptarAgregarUsuario_Click(object sender, EventArgs e) { if (this.txtEmailAgregarUsuario.Text == "") { this.errorProvider1.SetIconAlignment(this.txtEmailAgregarUsuario, ErrorIconAlignment.MiddleRight); this.errorProvider1.SetError(this.txtEmailAgregarUsuario, "Campo necesario"); this.txtEmailAgregarUsuario.Focus(); } else { Usuario nUsuario = ManejoUsuario.getById(frmBuscarUsuario.PKUSU); nUsuario.pkUsuario = frmBuscarUsuario.PKUSU; nUsuario.iEmpleadoUsuario = Convert.ToInt32(txtEmailAgregarUsuario.Text); fkRol = 2; nUsuario.sPassword = pass; ManejoUsuario.Modificar(nUsuario, fkRol); vMain.cargarUsuario(); this.Close(); } }
private void dgvPeriodoFecha_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { Venta mVenta = ManejoVenta.getById(Convert.ToInt32(dgvPeriodoFecha.CurrentRow.Cells[5].Value)); Cliente mCliente = ManejoCliente.getById(mVenta.cliente_id); Factura mFactura = ManejoFacturacion.getById(mVenta.factura_id); Usuario mUsuario = ManejoUsuario.getById(mVenta.usuario_id); List <PeriodoVentas> mDetalleVenta = ManejoPeriodo.getByDetalleVenta(mVenta.idVenta); txtFolioVenta.Text = mVenta.sFolio; txtFecha.Text = mVenta.dtFechaVenta.ToString(); txtTipoPago.Text = mVenta.sTipoPago; txtMoneda.Text = mVenta.sMoneda; if (mVenta.iTurno == 1) { txtTurno.Text = "MATUTINO"; } else if (mVenta.iTurno == 2) { txtTurno.Text = "VESPERTINO"; } txtCaja.Text = mVenta.iCaja.ToString(); decimal total = 0; decimal subtotal = 0; decimal cantidad = 0; decimal costo = 0; foreach (PeriodoVentas rDetalleVenta in mDetalleVenta) { DataGridViewRow row = (DataGridViewRow)dgvDetalleVenta.Rows[0].Clone(); row.Cells[0].Value = rDetalleVenta.idDetalleVenta; row.Cells[1].Value = rDetalleVenta.idProducto; row.Cells[2].Value = rDetalleVenta.sDescripcion; row.Cells[3].Value = rDetalleVenta.dCantidad; row.Cells[4].Value = rDetalleVenta.dCosto; cantidad = rDetalleVenta.dCantidad; costo = rDetalleVenta.dCosto; subtotal = cantidad * costo; row.Cells[5].Value = subtotal.ToString("N"); dgvDetalleVenta.Rows.Add(row); } foreach (DataGridViewRow row in dgvDetalleVenta.Rows) { total += Convert.ToDecimal(row.Cells[5].Value); } txtTotal.Text = total.ToString("N"); txtCambio.Text = mVenta.dCambio.ToString("N"); txtUsuario.Text = mUsuario.sNombre; if (mVenta.cliente_id != 0) { txtCliente.Text = mCliente.sNombre; } if (mVenta.factura_id != 0) { txtFolio.Text = mFactura.sFolio; } dgvPeriodos.Visible = false; btnReporte.Visible = false; lblalgo.Visible = false; btnIniciarPeriodo.Visible = false; btnFinalizarPeriodo.Visible = false; pnlReporte.Visible = false; pnlTotalGeneral.Visible = false; pnlDetallePeriodo.Visible = true; }