コード例 #1
0
        private string GetGameState(Game game)
        {
            if (game.UserStateRequired.HasValue)
            {
                switch ((KidsUserStatus)game.UserStateRequired)
                {
                    case KidsUserStatus.RegisterWithoutConfirmation:
                    case KidsUserStatus.RegisterdWithNoAcc:
                    case KidsUserStatus.WaiteForAccCreation:
                    case KidsUserStatus.WaiteForAccCreation_WithSabtConfirmation:
                    case KidsUserStatus.WaiteForAccCreation_Failed:
                    case KidsUserStatus.WaiteForAccCreation_FailedSabt:
                    case KidsUserStatus.WaiteForAccCreation_SentToSabt:
                        return "کاربران عضو";

                    case KidsUserStatus.AccCreated_WaiteForDBCR:
                    case KidsUserStatus.RegisterdCompletly:
                        return "کاربران عضو دارای حساب آرزو";
                    default:
                        throw new ArgumentOutOfRangeException();
                }
            }
            return "رایگان";

        }
コード例 #2
0
        private bool CanKidPlayThisGame(Game game)
        {
            KidsUser user = null;
            if (KidsSecureFormBaseClass.OnlineKidsUser != null)
                user = KidsSecureFormBaseClass.OnlineKidsUser.Kids_UserInfo;

            if (game.UserStateRequired.HasValue)
            {
                if (user != null)
                    return user.CurrentStatus.ToString().PadRight(2, '0').ToInt32() >= game.UserStateRequired.ToString().PadRight(2, '0').ToInt32();
                return false;
            }
            return true;

        }
コード例 #3
0
        public static void SaveGame(Game game)
        {
            using (var ctx = new BMIKidsEntities(ConnectionString))
            {
                try
                {
                    if (game.ChangeTracker.State == ObjectState.Unchanged)
                        game.MarkAsModified();

                    ctx.Games.ApplyChanges(game);
                    ctx.SaveChanges();
                }
                catch (Exception ex)
                {
                    LogUtility.WriteEntryEventLog("Game_DataProvider_DataProvider", ex, EventLogEntryType.Information);
                    if (ex.InnerException != null)
                        throw ex.InnerException;
                    throw;
                }
            }
        }
コード例 #4
0
 private Guid GetTemproryLink(Game game)
 {
     return TempLinkManager.Instanse.AddLink(MapPath(string.Format("/AdminCP/Files/Game/{0}", game.FileAddress)));
 }