示例#1
0
 public string ValidateUserName(string userName, string password)
 {
     try
     {
         if (Membership.ValidateUser(userName, password))
         {
             //kiem tra tiep userName co quyen tren app
             if (!UserPermission.HasAppPermision(userName))
             {
                 return("-2"); // Your account can not login on IOS. Please contact Admin.";
             }
             else
             {
                 int?companyID = UserPermission.GetCompanyId(userName, true);
                 if (companyID.HasValue)
                 {
                     return(companyID.Value.ToString());
                 }
                 else
                 {
                     return("-2");
                 }
             }
         }
         else
         {
             return("-1"); // "Login Failed. Please remember that passwords are case sensitive";
         }
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }