private string CreateMenuInfoUser(SessionDB sesion) { string menu = new StringBuilder() .Append("<li class=\"dropdown navbar-ser\"><a href=\"javascript:; \" class=\"dropdown-toggle\" data-toggle=\"dropdown\"> ") .Append("<img src=\"/Content/images/user.png\" width=\"\" height=\"30px\" /> <span class=\"hidden-xs\">") .Append("" + sesion.completeName) .Append("</span> <b class=\"caret\"></b></a>") .Append(" <ul class=\"dropdown-menu animated fadeInLeft\"> ") .Append("<li><a href=\"/Login/Close \">Cerrar Sesión</a></li> ") .Append("</ul></li> ") .Append("<input type=\"hidden\" id=\"session_val\" value=\"") .Append(EncryptX.Encode("" + sesion.pkUser + "," + sesion.idSesion)).Append("\"> ") .ToString(); return(menu); }
public ActionResult EditaPassword(Models.PasswordModel model) { try { Debug.WriteLine("enrto class edit: "); if (model.ActualizaPassword(EncryptX.Encode(model.password), EncryptX.Encode(model.passwordActual))) { return(Json(new { msg = Notification.Succes("Se ha editado con exito el Password") })); } else { return(Json(new { msg = Notification.Succes("Error al Editar Password") })); } } catch (Exception e) { return(Json(new { msg = Notification.Error(e.Message) })); } }
public ActionResult ValidaPassword(Models.PasswordModel model) { try { Debug.WriteLine("enrto class: "); if (model.ValidaPassword(EncryptX.Encode(model.passwordActual))) { return(Json(new { msg = "Existe" })); } else { return(Json(new { msg = "No Existe" })); } } catch (Exception e) { return(Json(new { msg = Notification.Error(e.Message) })); } }
private Dictionary <string, string> prepareData(bool add) { Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("USUARIO", Usuario); dic.Add("PASSWORD", EncryptX.Encode(Password)); dic.Add("NOMBRE", Nombre); dic.Add("APATERNO", APaterno); dic.Add("AMATERNO", AMaterno); dic.Add("RFC", RFC); dic.Add("EDAD", Edad); dic.Add("ACTIVO", Activo); dic.Add("CVE_SEDE", SedePrincipal); if (add) { dic.Add("FECHA_R", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); } else { dic.Add("FECHA_M", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); } dic.Add("PK_USUARIO", sesion.pkUser.ToString()); return(dic); }