public int UpdateConfiguracion(ConfiguracionVO vo) { string resp = string.Empty; try { string query = "sp_Configuracion_actualizar"; MySqlCommand comando = this.Conexion.CreateCommand(); comando.CommandType = CommandType.StoredProcedure; comando.CommandText = query; comando.Parameters.AddWithValue("p_tasa", vo.Tasa); comando.Parameters.AddWithValue("p_porcenganche", vo.PorcEnganche); comando.Parameters.AddWithValue("p_plazomaximo", vo.PlazoMaximo); comando.Parameters.AddWithValue("p_clave", vo.Clave); // Se toma el valor devuelto resp = comando.ExecuteScalar().ToString(); } catch (Exception Ex) { throw Ex; } return(int.Parse(resp)); }
public ActionResult CreateConfiguracion(ConfiguracionVO vo) { try { ConfiguracionsBS BS = new ConfiguracionsBS(); return(Json(BS.CreateConfiguracion(vo))); } catch (Exception ex) { return(Json(ParseException(new CCExcepcion(ex)))); } }
public int UpdateConfiguracion(ConfiguracionVO vo) { try { return(this.Con.UpdateConfiguracion(vo)); } catch (CCExcepcion) { throw; } catch (Exception ex) { throw new CCExcepcion(ex); } }
public ActionResult UpdateConfiguracion(ConfiguracionVO vo) { try { ConfiguracionsBS BS = new ConfiguracionsBS(); return(Json(BS.UpdateConfiguracion(vo))); } catch (CCExcepcion cfex) { List <object> lista = new List <object>(); lista.Add(ParseException(cfex)); return(Json(lista)); } catch (Exception ex) { return(Json(ParseException(new CCExcepcion(ex)))); } }
public ConfiguracionVO ConfiguracionObtenerPorClave( ) { MySqlDataReader dr = null; ConfiguracionVO vo = new ConfiguracionVO(); try { string query = "sp_Configuracion_select"; MySqlCommand comando = this.Conexion.CreateCommand(); comando.CommandType = CommandType.StoredProcedure; comando.CommandText = query; // Se toma el valor devuelto dr = comando.ExecuteReader(); if (dr.HasRows) { dr.Read(); vo = new ConfiguracionVO(); vo.Clave = dr.GetInt32(dr.GetOrdinal("Clave")); vo.Tasa = dr.GetDecimal(dr.GetOrdinal("Tasa")); vo.PorcEnganche = dr.GetDecimal(dr.GetOrdinal("PorcEnganche")); vo.PlazoMaximo = dr.GetInt32(dr.GetOrdinal("PlazoMaximo")); } } catch (Exception Ex) { throw Ex; } finally { if (dr != null && !dr.IsClosed) { dr.Close(); } dr = null; } return(vo); }
public string ConfiguracionEliminar(ConfiguracionVO vo) { string resp = string.Empty; try { string query = "sp_contaConfiguracion_eliminar"; MySqlCommand comando = this.Conexion.CreateCommand(); comando.CommandType = CommandType.StoredProcedure; comando.CommandText = query; comando.Parameters.AddWithValue("p_id", vo.Clave); // Se toma el valor devuelto resp = comando.ExecuteScalar().ToString(); } catch (Exception Ex) { throw Ex; } return(resp); }