public JsonResult EnviarMensaje(string mensaje, string traza) { Librearia obj = new Librearia(); if (!(Session["attender"].ToString() == "Si")) { traza = "Funcionario" + r.getRegistro(Int32.Parse(traza)).attender; } IConnection con = obj.GetConnection(); bool flag = obj.send(con, mensaje, traza); return(Json(null)); }
public JsonResult Recibir() { try { string userqueue = ""; Librearia obj = new Librearia(); IConnection con = obj.GetConnection(); if (Session["usremail"] == null) { //funcionario if (Session["usrname"] != null) { userqueue = "Funcionario" + Session["usrid"].ToString(); } } else { //cliente userqueue = Session["usremail"].ToString(); } string message = obj.receive(con, userqueue); //Mensaje Stock #region string cadena = message; var arr = cadena.Contains("/stock="); if (arr) { int sizecode = "/stock=".Length; int tamano = cadena.Contains("/stock=").ToString().Length; cadena = cadena.Substring(sizecode); string urlcsv = "https://stooq.com/q/l/?s=aapl.us&f=sd2t2ohlcv&h&e=csv"; string result = getCSV(urlcsv, cadena); message = cadena + " quote is $" + result; } #endregion return(Json(message)); } catch (Exception ex) { return(null); } }