Exemplo n.º 1
0
 public ActionResult ResetTem()
 {
     try
     {
         InvServiceFactory.Initial();
         ViewData["MessageResetTem"] = "Reset mau thanh cong.";
         return(View());
     }
     catch (Exception ex)
     {
         log.Error(ex);
         ViewData["MessageResetTem"] = "Reset mau khong thanh cong.";
         return(View());
     }
 }
Exemplo n.º 2
0
 public string ResetTem(string username, string password)
 {
     try
     {
         IRBACMembershipProvider _MemberShipProvider = IoC.Resolve <IRBACMembershipProvider>();
         user model = _MemberShipProvider.GetUser(username, true);
         if (model.password == FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5"))
         {
             string name = (from e in model.Roles where e.name.Contains("Root") select e.name).FirstOrDefault();
             if (name == "Root")
             {
                 InvServiceFactory.Initial();
                 return("Reset thanh cong!");
             }
         }
         return("Reset khong thanh cong!");
     }
     catch (Exception ex)
     {
         return("Reset khong thanh cong!");
     }
 }