public static Commons.Transmition.EmailResponse ValidateEmail(String UserName) { Commons.Transmition.EmailResponse obj = new Commons.Transmition.EmailResponse(); using (IndexEntities db = new IndexEntities()) { spg_TransmitionGetUserEmail_Result result = db.spg_TransmitionGetUserEmail(UserName).FirstOrDefault(); obj.Email = result.Email; obj.HasPremission = (Boolean)result.HasPremission; } return(obj); }
public JsonResult ValidateEmail() { Commons.User UserInfo = (Commons.User)Session["USERINFO"]; IRestResponse WSR = Task.Run(() => apiClient.getJArray("Transmision/ValidarEmail", "UserName=" + UserInfo.UserName)).Result; if (WSR.StatusCode == HttpStatusCode.OK) { Commons.Transmition.EmailResponse data = JObject.Parse(WSR.Content).ToObject <Commons.Transmition.EmailResponse>(); return(Json(data, JsonRequestBehavior.AllowGet)); } else { return(Json(JObject.Parse(WSR.Content).ToObject <Error>().Message.ToString(), JsonRequestBehavior.AllowGet)); } }