/// <summary>
        /// required implementation
        /// </summary>
        /// <param name="emailToMatch">required implementation</param>
        /// <param name="pageIndex">required implementation</param>
        /// <param name="pageSize">required implementation</param>
        /// <param name="totalRecords">required implementation</param>
        /// <returns>required implementation</returns>
        public IList <user> FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
        {
            log.Info("FindUsersByEmail Application " + _App.AppName);
            if (pageIndex > 0 && pageSize > 0)
            {
                UserSrv.SetFetchPage((pageIndex - 1) * pageSize, pageSize);
            }
            //string HQL = "select u from user u join u.ApplicationList app where u.email like %:email% AND app.AppID = :AppID  ";

            try
            {
                //IList<user> lst = UserSrv.GetbyHQuery(HQL,new SQLParam("email",emailToMatch),new SQLParam("AppID",_App.AppID));
                IList <user> lst = UserSrv.SearchUser(string.Empty, emailToMatch, _App.AppID);
                totalRecords = lst.Count;

                return(lst);
            }
            catch (Exception ex)
            {
                log.Error("FindUserEmail Error Application " + _App.AppName, ex);
                totalRecords = 0;
                return(null);
            }
        }
Example #2
0
 /// <summary>
 /// search user in current Application. Using [Like] command . if username and Email = string.empty then return all user in current Applications
 /// </summary>
 /// <param name="userName">if = string.Empty then not consider this conditions</param>
 /// <param name="Email">if = string.Empty then not consider this conditions</param>
 /// <returns></returns>
 public IList <user> SearchUser(string userName, string Email)
 {
     return(UserSrv.SearchUser(userName, Email, App.AppID));
 }