public int DeleteProfiles(string usernames)
 {
     IuserService UserSrv = new userService(SessionFactoryConfigPath);
     user mUser= UserSrv.GetByName(usernames);
     if (mUser == null) return 0;
     string Hql = "Delete UserProfile where UserId =:UserId";
     return (int)UserSrv.ExcuteNonQuery(Hql,true, new SQLParam("UserId", mUser.userid));
 }
Example #2
0
        public int DeleteProfiles(string usernames)
        {
            IuserService UserSrv = new userService(SessionFactoryConfigPath);
            user         mUser   = UserSrv.GetByName(usernames);

            if (mUser == null)
            {
                return(0);
            }
            string Hql = "Delete UserProfile where UserId =:UserId";

            return((int)UserSrv.ExcuteNonQuery(Hql, true, new SQLParam("UserId", mUser.userid)));
        }
Example #3
0
        public int DeleteProfiles(string[] usernames)
        {
            IuserService UserSrv = new userService(SessionFactoryConfigPath);
            int          ret     = 0;

            foreach (string UN in usernames)
            {
                user mUser = UserSrv.GetByName(UN);
                if (mUser != null)
                {
                    string Hql = "Delete UserProfile where UserId =:UserId";
                    ret += (int)UserSrv.ExcuteNonQuery(Hql, true, new SQLParam("UserId", mUser.userid));
                }
            }
            return(ret);
        }
Example #4
0
        /// <summary>
        /// required implementation
        /// </summary>
        /// <param name="userName">required implementation</param>
        /// <returns>required implementation</returns>
        public bool UnlockUser(string userName)
        {
            log.Info("UnlockUser:"******" in Application: " + _App.AppName);
            string HQL = "update user u set u.IsLockedOut = false join u.Applications app where u.username = :username AND app.AppID=:AppID";

            try
            {
                IuserService UserSrv = new userService(SessionFactoryConfigPath);
                object       ret     = UserSrv.ExcuteNonQuery(HQL, true, new SQLParam("username", userName), new SQLParam("AppID", _App.AppID));
                return(true);
            }
            catch (Exception ex)
            {
                log.Error("Error UnlockUser: "******" in Application: " + _App.AppName, ex);
                return(false);
            }
            //throw new Exception("have not implement.");
        }
 public int DeleteProfiles(string[] usernames)
 {
     IuserService UserSrv = new userService(SessionFactoryConfigPath);
     int ret = 0;
     foreach (string UN in usernames)
     {
         user mUser = UserSrv.GetByName(UN);
         if (mUser != null)
         {
             string Hql = "Delete UserProfile where UserId =:UserId";
             ret += (int)UserSrv.ExcuteNonQuery(Hql, true,new SQLParam("UserId", mUser.userid));
         }
     }
     return ret;
 }