示例#1
0
        public static void  MakeAdmin(string userIDs, RankE humanRankID, RoleE roleID)
        {
            System.Data.SqlClient.SqlTransaction t = null;

            try
            {
                t = SqlHelper.BeginTransaction(Config.ConnectionString);

                //BaseCollection.ExecuteSql2(t, "update [User] set HumanRankID = " +humanRankID.ToString("d") +" WHERE userID in (" +userIDs +")");
                BaseCollection.ExecuteSql2(t, "update [UserRole] set RoleID = " + roleID.ToString("d") + " WHERE userID in (" + userIDs + ")");


                SqlHelper.CommitTransaction(t);
            }
            catch (Exception ex)
            {
                SqlHelper.RollbackTransaction(t);
                Log.Write(Ap.Cxt, ex);
            }
        }
示例#2
0
 public static bool IsInRole(RoleE role)
 {
     return UWeb.Principal.IsInRole(((int)role).ToString());
 }
示例#3
0
 public static bool IsInRole(RoleE role)
 {
     return(UWeb.Principal.IsInRole(((int)role).ToString()));
 }