public bool CambiarEstado(RegistroPagosEntidad mcEntidad) { cmd.Connection = cnx; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "SP_CambioEstadoRegPrestamos"; try { cmd.Parameters.Add(new SqlParameter("@numeroPrestamo", SqlDbType.Int)); cmd.Parameters["@numeroPrestamo"].Value = mcEntidad.numPrestamo; cmd.Parameters.Add(new SqlParameter("@fechaProxPago", SqlDbType.Date, 60)); cmd.Parameters["@fechaProxPago"].Value = mcEntidad.fechProxPago; cnx.Open(); cmd.ExecuteNonQuery(); vexito = true; } catch (SqlException) { vexito = false; } finally { if (cnx.State == ConnectionState.Open) { cnx.Close(); } cmd.Parameters.Clear(); } return(vexito); }
private void BuscarDatos() { try { if (Session["idRegistroPrestamo"] != null) { int cod = Convert.ToInt32(Session["idRegistroPrestamo"].ToString()); RegistroEnt = RegistroNeg.ConsultarRegistroPago(cod); { txtId.Text = RegistroEnt.id.ToString(); txtNumPrestamo.Text = RegistroEnt.numPrestamo.ToString(); txtNumEmpleado.Text = RegistroEnt.numEmpleado.ToString(); txtFechaPago.Text = RegistroEnt.fechPago.ToString(); //dpPlazo.SelectedIndex = RegistroEnt.idPla; txtFechaProxPago.Text = RegistroEnt.fechProxPago.ToString(); //dpEstado.SelectedIndex = RegistroEnt.idEstad; txtMonto.Text = RegistroEnt.montAPagar.ToString(); txtTotal.Text = RegistroEnt.totaPagado.ToString(); txtIdPrestamo.Text = RegistroEnt.idPres.ToString(); } } } catch (Exception) { lblMensaje.Text = "Ha ocurrido un error, registro no encontrado"; } }
public bool InsertarRegistroPago(RegistroPagosEntidad mcEntidad) { cmd.Connection = cnx; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "SP_CrearRegistroPagos"; try { cmd.Parameters.Add(new SqlParameter("@numeroPrestamo", SqlDbType.Int)); cmd.Parameters["@numeroPrestamo"].Value = mcEntidad.numPrestamo; cmd.Parameters.Add(new SqlParameter("@numeroEmpleado", SqlDbType.Int)); cmd.Parameters["@numeroEmpleado"].Value = mcEntidad.numEmpleado; cmd.Parameters.Add(new SqlParameter("@fechaPago", SqlDbType.DateTime)); cmd.Parameters["@fechaPago"].Value = mcEntidad.fechPago; cmd.Parameters.Add(new SqlParameter("@idPlazo", SqlDbType.Int)); cmd.Parameters["@idPlazo"].Value = mcEntidad.idPla; cmd.Parameters.Add(new SqlParameter("@fechaProxPago", SqlDbType.DateTime)); cmd.Parameters["@fechaProxPago"].Value = mcEntidad.fechProxPago; cmd.Parameters.Add(new SqlParameter("@idEstado", SqlDbType.Int)); cmd.Parameters["@idEstado"].Value = mcEntidad.idEstad; cmd.Parameters.Add(new SqlParameter("@montoAPagar", SqlDbType.Int)); cmd.Parameters["@montoAPagar"].Value = mcEntidad.montAPagar; cmd.Parameters.Add(new SqlParameter("@totalPagado", SqlDbType.Int)); cmd.Parameters["@totalPagado"].Value = mcEntidad.totaPagado; cmd.Parameters.Add(new SqlParameter("@idPrestamo", SqlDbType.Int)); cmd.Parameters["@idPrestamo"].Value = mcEntidad.idPres; cnx.Open(); cmd.ExecuteNonQuery(); vexito = true; } catch (SqlException e) { vexito = false; } finally { if (cnx.State == ConnectionState.Open) { cnx.Close(); } cmd.Parameters.Clear(); } return(vexito); }
public bool CambiarEstado(RegistroPagosEntidad RegistroPagosEntidad) { return(_RegistroPagosDatos.CambiarEstado(RegistroPagosEntidad)); }
public bool CrearRegistroPago(RegistroPagosEntidad RegistroPagosNegocio) { return(_RegistroPagosDatos.InsertarRegistroPago(RegistroPagosNegocio)); }