Beispiel #1
0
 /// <summary>
 /// required implementation
 /// </summary>
 /// <param name="email">required implementation</param>
 /// <returns>required implementation</returns>
 public string GetUserNameByEmail(string email)
 {
     log.Info("GetUserNameByEmail:" + email + " in Application: " + _App.AppName);
     //string HQL = "select u from user u join u.ApplicationList app where u.email = :email AND app.AppID = :AppID  ";
     try
     {
         IuserService UserSrv = new userService(SessionFactoryConfigPath);
         //IList<user> lst = UserSrv.GetbyHQuery(HQL, new SQLParam("email", email), new SQLParam("AppID", _App.AppID));
         IList <user> lst = UserSrv.SearchUser("", email, _App.AppID);
         return((lst == null || lst.Count == 0) ? null : lst[0].username);
     }
     catch (Exception ex)
     {
         log.Error("Error GetUserNameByEmail: " + email + " in Application: " + _App.AppName, ex);
         return("");
     }
 }