public string Buscar_Uno(ref oValor pS_Valor) { string sError = ""; try { SqlDataReader dr = null; dr = oCon.ExecReader("web_Valores_Buscar", CommandType.StoredProcedure); if (dr.HasRows) { while (dr.Read()) { pS_Valor.Verde = Convert.ToDecimal(dr["codeneVerde"].ToString()); pS_Valor.Amarillo = Convert.ToDecimal(dr["codeneAmarillo"].ToString()); pS_Valor.Rojo = Convert.ToDecimal(dr["codeneRojo"].ToString()); } } else { throw new Exception("El valor seleccionado no existe"); } dr.Close(); dr = null; } catch (Exception ex) { sError = ex.Message; } return(sError); }
protected void Page_Load(object sender, EventArgs e) { nValor unValorN = new nValor(); oValor unValorO = new oValor(); string sError = unValorN.Buscar_Uno(ref unValorO); lblValorVerde.Text = unValorO.Verde.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { nValor unValorN = new nValor(); oValor unValorO = new oValor(); string sError = unValorN.Buscar_Uno(ref unValorO); txtMiCodene.Text = unValorO.Verde.ToString(); txtDeTercerosCodene.Text = unValorO.Amarillo.ToString(); } }
protected void btnGuardar_Click(object sender, EventArgs e) { nValor unValorN = new nValor(); oValor unValorO = new oValor(); unValorO.Verde = decimal.Parse(txtMiCodene.Text.Replace('.', ',')); unValorO.Amarillo = decimal.Parse(txtDeTercerosCodene.Text.Replace('.', ',')); string sError = unValorN.Alta(ref unValorO); txtMiCodene.Text = unValorO.Verde.ToString(); txtDeTercerosCodene.Text = unValorO.Amarillo.ToString(); }
public string Alta(ref oValor pE_Valor) { try { string[,] strParameters = { { "@pE_codeneVerde", pE_Valor.Verde.ToString().Replace(',', '.') }, { "@pE_codeneAmarillo", pE_Valor.Amarillo.ToString().Replace(',', '.') }, { "@pE_codeneRojo", pE_Valor.Rojo.ToString().Replace(',', '.') } }; oCon.ExecNonQuery("web_Valores_Alta", CommandType.StoredProcedure, strParameters); return(""); } catch (Exception ex) { return(ex.Message); } }
public string Buscar_Uno(ref oValor pS_Valor) { return(dValor.Buscar_Uno(ref pS_Valor)); }
public string Alta(ref oValor pE_Valor) { return(dValor.Alta(ref pE_Valor)); }