Inheritance: MonoBehaviour
        // Override the CheckPermissions method
        public async override Task <PreconditionResult> CheckPermissions(ICommandContext context, CommandInfo command, IServiceProvider _services)
        {
            var userStorage = UserDataManager.GetUserStorage();

            //Create xml user credit entry if user does not exist
            if (!userStorage.UserInfo.TryGetValue(context.Message.Author.Id, out var i))
            {
                //Create user profile
                UserDataManager.CreateNewUserXmlEntry(context as SocketCommandContext);
            }


            //Create user stock entry if stock entry does not exist
            if (!File.Exists(CoreMethod.GetFileLocation(@"\UserStocks") + @"\" + context.Message.Author.Id + ".xml"))
            {
                //Create user profile
                //Write user stock amount
                var userStockRecord = new UserStockStorage
                {
                    UserStock = new List <UserStock>
                    {
                        //new UserStock {StockTicker="DUCK", StockAmount=0, StockBuyPrice=0 }
                    }
                };

                XmlManager.ToXmlFile(userStockRecord, CoreMethod.GetFileLocation(@"\UserStocks") + @"\" + context.User.Id.ToString() + ".xml");
            }

            return(PreconditionResult.FromSuccess());
        }
Esempio n. 2
0
        //记住密码
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            loginAnimate.Visibility = Visibility.Collapsed;
            manyProject.Visibility  = Visibility.Collapsed;
            login.Visibility        = Visibility.Visible;


            if (e.NavigationMode == NavigationMode.New)
            {
                UserInfo user = UserDataManager.LoadUserSettings();
                if (user != null && user.RememberPwd && !string.IsNullOrEmpty(user.Token))
                {
                    loginAnimate.Visibility = Visibility.Visible;
                    App.Token = user.Token;
                    NavigationService.Navigate(new Uri("/View/MainPost.xaml", UriKind.Relative));
                }
                else if (user != null && user.RememberPwd)
                {
                    txtUserEmail.Text         = user.UserEmail;
                    txtPasswrod.Password      = user.UserPwd;
                    loginAnimate.Visibility   = Visibility.Visible;
                    txtPassWordTip.Visibility = Visibility.Collapsed;
                    LoginViewModel.UserLogin(user.UserEmail, user.UserPwd, "", LoginResult);
                }
            }
            base.OnNavigatedTo(e);
        }
Esempio n. 3
0
        public ActionResult _Login(ConnexionVM userCredentials)
        {
            if (ModelState.IsValid)
            {
                ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings["ValaisBookingDBAccess"];
                string connectionString           = settings.ConnectionString;

                UserData user = UserDataManager.GetUserFromEmail(userCredentials.Email);

                if (user != null)
                {
                    if (user.PasswordMd5 == Toolbox.GetMD5(userCredentials.Password))
                    {
                        Session["userData"] = user;

                        if (userCredentials.SaveCookie)
                        {
                            FormsAuthentication.SetAuthCookie(user.Email, true);
                        }
                        else
                        {
                            FormsAuthentication.SetAuthCookie(user.Email, false);
                        }

                        return(PartialView(userCredentials));
                    }
                    else
                    {
                        ModelState.AddModelError(String.Empty, "Données de connexion invalides");
                    }
                }
            }
            return(PartialView(userCredentials));
        }
Esempio n. 4
0
        public Bet(UserDataManager manager, Match match, POCO.BetPoco poco)
        {
            Id = poco._id;
            MyMatch = match;
            MatchHash = poco.match_hash;
            UserContext = manager.User;

            SetOutcome(poco.outcome);

            if (match != null)
            {
                if (match.Player1 != null && poco.offerer_choice_id == match.Player1.Id)
                {
                    OffererChoice = match.Player1;
                    TakerChoice = match.Player2;
                }
                else
                {
                    OffererChoice = match.Player2;
                    TakerChoice = match.Player1;
                }
            }

            var offerer = new POCO.UserBase { _id = poco.offerer_id, username = poco.offerer_username };
            Offerer = manager.GetPgUser(offerer);
            OffererOdds = poco.offerer_odds;
            OffererWager = poco.offerer_wager;

            var taker = new POCO.UserBase { _id = poco.taker_id, username = poco.taker_username };
            if (!string.IsNullOrWhiteSpace(taker._id))
                Taker = manager.GetPgUser(taker);
        }
Esempio n. 5
0
    //스크롤 정렬
    private int[] getOrder()
    {
        int[] data_order;
        int   total_list_num = ItemList.Count;

        data_order = new int[total_list_num];

        for (int i = 0; i < data_order.Length; i++)
        {
            data_order[i] = 0;
        }

        UserDataManager u_data = UserDataManager.Inst;

        for (int i = 0; i < total_list_num - 1; i++)
        {
            for (int j = i + 1; j < total_list_num; j++)
            {
                if (CSVData.Inst.GetItemData(ItemList[i].id).id < CSVData.Inst.GetItemData(ItemList[j].id).id)
                {
                    data_order[i]++;
                }
                else
                {
                    data_order[j]++;
                }
            }
        }

        return(data_order);
    }
Esempio n. 6
0
	void Start()
	{
		// Caching
		userDatamanager = UserDataManager.ins;
		if (userDatamanager == null)
		{
			Debug.LogError("No UserDataManager?!");
		}
		applicationManager = ApplicationManager.ins;
		if (applicationManager == null)
		{
			Debug.LogError("No ApplicationManager?!");
		}
		courseManager = CourseManager.ins;
		if (courseManager == null)
		{
			Debug.LogError("No CourseManager?!");
		}
		modalPanel = ModalPanel.ins;
		if (modalPanel == null)
		{
			Debug.LogError("No ModalPanel?!");
		}
		courseCompletedOKEvent = new UnityAction(_CourseCompleted);
		courseViewCompletedOKEvent = new UnityAction(_CourseViewContinue);
		courseViewCompletedCancelEvent = new UnityAction(_CourseViewStay);

		audioManager = ASAudioManager.ins;
		if (audioManager == null)
		{
			Debug.LogError("No ASAudioManager?!");
		}
	}
Esempio n. 7
0
 protected void Session_Start(object sender, EventArgs e)
 {
     if (User.Identity.Name != null)
     {
         Session["UserData"] = UserDataManager.GetUserFromEmail(User.Identity.Name);
     }
 }
Esempio n. 8
0
    void Update()
    {
        _cloudSpawner.update(Time.deltaTime);
        AnimationManager.GetInstance().update(Time.deltaTime);

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            ExitGame();
        }

        if (testMode)
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                TestManager.GetInstance().AdvanceTillPhase(TypeFase.HARVEST);
            }
            if (Input.GetKeyDown(KeyCode.Z))
            {
                gameObject.GetComponent <TimeManager> ().calendar._currentYear = 2996;
                TestManager.GetInstance().InvestigateEverything();
                //UserDataManager.GetInstance ().addGold(-18000.0f);
                UserDataManager.GetInstance().addGold(30000.0f);
                //UserDataManager.GetInstance ().addRiceProduced (123);
                //UserDataManager.GetInstance ().sellRice(5000);
                //UserDataManager.GetInstance ().rice.setTotalRiceProduced (5000);
                //UserDataManager.GetInstance ().addGold(3000.0f);
            }
        }
    }
Esempio n. 9
0
        private async Task AddRep(SocketUser user)
        {
            if (user.Id == Context.User.Id)
            {
                await ReplyAsync(BotUtils.KamtroText("You can't give a repuation point to yourself!"));

                return;
            }

            // Change formatting based on nicknames and channel
            SocketGuildUser targetGuildUser = BotUtils.GetGUser(user.Id);
            SocketGuildUser currentUser     = BotUtils.GetGUser(Context);

            await UserDataManager.AddRep(currentUser, targetGuildUser);

            // Notify user if they have notification on
            if (UserDataManager.GetUserSettings(targetGuildUser).RepNotify)
            {
                await targetGuildUser.SendMessageAsync(BotUtils.KamtroText($"You have received a reputation point from {currentUser.GetDisplayName()}."));
            }

            if (Context.Channel is SocketDMChannel)
            {
                await ReplyAsync(BotUtils.KamtroText($"You have given a reputation point to {targetGuildUser.GetDisplayName()}."));
            }
            else
            {
                SocketGuildUser guildUser = BotUtils.GetGUser(Context);

                await ReplyAsync(BotUtils.KamtroText($"{guildUser.GetDisplayName()} has given a reputation point to {targetGuildUser.GetDisplayName()}."));
            }
        }
Esempio n. 10
0
        private async Task Profile(SocketGuildUser user)
        {
            ProfileEmbed pe = new ProfileEmbed(UserDataManager.GetUserData(user), user);

            UpdateUserNames(user);
            await pe.Display(Context.Channel);
        }
Esempio n. 11
0
    public void constructionBuildingConfirm()
    {
        if (logicState == LOGIC_STATE.DELETING)
        {
            deletingConfirm();
        }
        else
        {
            if (BUILDING_INFO.terrainID == TileTerrainType.BUILDING)
            {
                buildBuilding(BUILDING_INFO.buildingID, _tileSelectedPosition [0], _tileSelectedPosition [1]);

                Building building = BuildingsManager.GetInstance().getBuilding(BUILDING_INFO.buildingID);
                building.constructAtPos(_tileSelectedPosition [0], _tileSelectedPosition [1]);
            }
            else if (BUILDING_INFO.terrainID == TileTerrainType.RICE_TERRAIN)
            {
                WorldTerrain.GetInstance().createRiceChunk(_tileSelectedPosition [0], _tileSelectedPosition [1], false);
            }
            else if (BUILDING_INFO.terrainID == TileTerrainType.CANAL)
            {
                WorldTerrain wt = WorldTerrain.GetInstance();
                wt.confirmCanalsTmp();
                UserDataManager.GetInstance().gold.espendGold(_buildingPanel.GetComponent <MultipleBuildingPanel> ().getCost());
            }
            BUILDING_INFO.clearRepresentation();
        }

        logicState = LOGIC_STATE.DEFAULT;
    }
Esempio n. 12
0
    public void constructionBuildingCancel()
    {
        if (logicState == LOGIC_STATE.DELETING)
        {
            deletingCancel();
        }
        else
        {
            BUILDING_INFO.clearRepresentation();

            if (BUILDING_INFO.terrainID == TileTerrainType.BUILDING)
            {
                Building building = BuildingsManager.GetInstance().getBuilding(BUILDING_INFO.buildingID);
                UserDataManager.GetInstance().gold.addGold(building.getInitialCost());
            }
            else if (BUILDING_INFO.terrainID == TileTerrainType.RICE_TERRAIN)
            {
                UserDataManager.GetInstance().gold.addGold(WorldTerrain.PRICE_RiceChunk);
            }
            else if (BUILDING_INFO.terrainID == TileTerrainType.CANAL)
            {
                WorldTerrain wt = WorldTerrain.GetInstance();
                wt.cancelCanalsTmp();
            }
        }

        if (_buildingPanel != null)
        {
            _buildingPanel.SendMessage("kill");
        }

        logicState = LOGIC_STATE.DEFAULT;
    }
Esempio n. 13
0
 private void GetData()
 {
     UserData model = new UserDataManager().GetModel(this.Session["userName"].ToString());
     if (model == null)
     {
         base.Response.Write("<script type='text/javascript'>window.location.href='index.aspx';</script>");
     }
     else
     {
         this.unLb.Text = model.userName;
         this.rfLb.Text = model.refName;
         this.realtx.Text = model.realName;
         this.baLb.Text = model.bankName;
         this.topNameLb.Text = new ManaDataManager().GetModel(model.userName).topName;
         this.grouplb.Text = Mark.GetGroupName(model.groupId);
         this.buLb.Text = model.bankNum;
         this.phtx.Text = model.phone;
         this.pidTx.Text = model.pid;
         this.bankAddrTx.Text = model.bankAddr;
         this.qqNumTx.Text = model.qqNum;
         this.addtx.Text = model.address;
         this.zipTx.Text = model.zip;
         this.niChengTx.Text = model.niCheng;
         this.regNameLb.Text = model.regName;
         this.lastMoney.Text = model.lastMoney.ToString("F2");
         this.ficit.Text = model.zhuceMoney.ToString("F2");
         this.jiaoyiLb.Text = model.cfMoney.ToString("F2");
         model = null;
     }
 }
Esempio n. 14
0
    //加载关卡prefab
    public void loadStage()
    {
        var stageName = _stage.PrefabName;

        if (stageName == null)
        {
            stageName = "Stage";
        }

        if (stage != null)
        {
            ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.LoadStage), null);
            ResetSceneControl();
            DestroyImmediate(stage.gameObject);
            // Destroy(stage.gameObject);
        }

        //加载prefab
        // stage = (GameObject)Instantiate(Resources.Load("Prefabs/Stage/Stage"));
        stage = (GameObject)Instantiate(Resources.Load("Prefabs/Stage/" + stageName));
        mask  = (GameObject)Instantiate(Resources.Load("Prefabs/Objects/Mask"));
        AudioManager.GetInstance().PlayNewAudio("Audio/Stage/" + _stage.Chapter.ChapterAudio);
        UserData  userData  = UserDataManager.GetInstance().GetUserData();
        UserStage userStage = userData.GetUserStage(_stage.StageId);
        // _star = userStage.Star;
        GameObject obj = GameObject.Find("SceneControl");
        // GameObject sr = GameObject.Find(stage.name + "/Sprite");
        // _spr = sr.GetComponent<SpriteRenderer>();
        // SceneControl sc = obj.GetComponent<SceneControl>();
        // ClickAndRotate car = spr.GetComponent<ClickAndRotate>();
        // car.SetChecked(true);
    }
Esempio n. 15
0
        /// <summary>
        /// Thread that handles all events that depend on the date
        /// </summary>
        public static void WeeklyReset()
        {
            while (true)
            {
                // Check for missed reset
                if (DateTime.UtcNow.RoundUp(TimeSpan.FromDays(1)) - LastDate.LastWeeklyReset.RoundUp(TimeSpan.FromDays(1)) >= new TimeSpan(7, 0, 0, 0))
                {
                    // reset things
                    UserDataManager.ResetWeekly();
                    UserDataManager.ResetRep();

                    // set the new time
                    LastDate.LastWeeklyReset = DateTime.UtcNow.LastSunday();

                    LastDate.Save();
                }
                else
                {
                    // if no reset was missed, wait for the next one.
                    Thread.Sleep(GetTimeDelay(TimeScale.WEEK));
                    // now reset rep
                    UserDataManager.ResetRep();
                    UserDataManager.ResetWeekly();
                    LastDate.LastWeeklyReset = DateTime.UtcNow.AddDays(-1).AddSeconds(1).RoundUp(TimeSpan.FromDays(1));
                    LastDate.Save();
                }

                KLog.Debug($"Last Weekly Reset: [{LastDate.LastWeeklyReset.ToString("F", CultureInfo.InvariantCulture)}]");

                Thread.Sleep(5000);  // SAFETY CLOCK, If the loop goes haywire it's not going to overload the bot.
            }
        }
Esempio n. 16
0
    public bool init()
    {
        //GameObject.FindGameObjectWithTag("Logic").GetComponent<PhaseManager>().readJSON();
        _tileSelectedPosition = new uint[2] {
            28, 25
        };
        _hasTileSelected = false;
        m_monthsInRed    = 0;
        m_monthsSinceIShowedInRedPopup = 0;
        b_warningInRedPopupShown       = false;
        //_terrainLogic = new RiceTerrainLogic();
        ActionManager.GetInstance();
        CoopManager.GetInstance();
        PenalizationManager.GetInstance();
        WorldTerrain.GetInstance().initWorld();
        BuildingsManager.GetInstance().init();
        UserDataManager.GetInstance().init();
        UserDataManager.GetInstance().gold.setGold(6800);
        RiceObjectsManager.GetInstance();
        _cloudSpawner = new CloudSpawner(WorldTerrain.CLOUDS_Z_LAYER);

        _tutMan.startTuto(new Tutorial_Inicial());
        GameSaveDataManager.init();

        return(true);
    }
Esempio n. 17
0
        public static void DailyReset()
        {
            while (true)
            {
                if (DateTime.UtcNow.RoundUp(TimeSpan.FromHours(1)) - LastDate.LastDailyReset.RoundUp(TimeSpan.FromDays(1)) >= new TimeSpan(1, 0, 0, 0))
                {
                    // reset things
                    UserDataManager.ResetKamtrokenEarns();
                    ShopManager.GenShopSelection();

                    // set the new time
                    LastDate.LastDailyReset = DateTime.UtcNow;
                    LastDate.Save();
                }
                else
                {
                    // if no reset was missed, wait for the next one.
                    Thread.Sleep(GetTimeDelay(TimeScale.DAY));

                    // now reset rep
                    UserDataManager.ResetKamtrokenEarns();

                    LastDate.LastDailyReset = DateTime.UtcNow;
                    LastDate.Save();
                }

                Thread.Sleep(5000); // SAFETY THROTTLE
            }
        }
Esempio n. 18
0
 void Start()
 {
     dataManager = GameManager.instance.GetUserDataManager();
     skinManager = GameManager.instance.GetSkinManager();
     curInd      = dataManager.GetCurUser().playerSkinInd;
     SwitchCharacter();
 }
Esempio n. 19
0
    void Start()
    {
        if (courseListObject == null)
        {
            Debug.LogError("No courseListObject referenced");
        }
        if (courseDisplayPrefab == null)
        {
            Debug.LogError("No courseDisplayPrefab referenced");
        }
        if (welcome == null)
        {
            Debug.LogError("No welcome object referenced");
        }

        // Course manager
        courseManager = CourseManager.ins;
        if (courseManager == null)
        {
            Debug.LogError("No CourseManager?");
        }

        // User data manager
        userDataManager = UserDataManager.ins;
        if (userDataManager == null)
        {
            Debug.LogError("No UserDataManager?");
        }

        LoadCoursesIntoList();
        LoadUserInfo();
    }
Esempio n. 20
0
        public void DeleteAsync_ExistingNotification_RemovesNotificationFromDatabase()
        {
            var(context, notificationService) = CreateTestTools(
                nameof(DeleteAsync_ExistingNotification_RemovesNotificationFromDatabase)
                );

            var testUser     = UserDataManager.CreateTestUser(context);
            var notification = new Notification()
            {
                Content        = "Test message",
                ContentType    = "text/plain",
                RecipientsList = new List <string> {
                    testUser.Email
                }
            };

            NotificationDataManager.CreateNotification(context, notification, NotificationType.API);
            notification = new Notification(context.Notifications.First());

            var task = notificationService.DeleteAsync(notification);

            task.Wait();

            Assert.Null(context.Notifications.Find(notification.Id));
        }
Esempio n. 21
0
        public void GetGroup_UserAuthorizedGroupAdmin_ReturnsRequiredGroupDetails()
        {
            var(context, controller) = CreateTestTools(
                nameof(GetGroup_UserAuthorizedGroupAdmin_ReturnsRequiredGroupDetails)
                );
            var user = UserDataManager.AuthorizeControllerUser(controller, context);

            var member1   = UserDataManager.CreateUser(context, "*****@*****.**");
            var member2   = UserDataManager.CreateUser(context, "*****@*****.**");
            var notMember = UserDataManager.CreateUser(context, "*****@*****.**");

            var group = GroupDataManager.CreateGroup(
                context, "Test group", user, new List <Database.POCO.User> {
                member1, member2
            }
                );

            var result = controller.GetGroup(group.Id) as JsonResult;

            Assert.NotNull(result);

            var groupDetails = result.Value as GroupDetails;

            Assert.NotNull(groupDetails);
            AssertUserListsEqual(group.Users.ToList(), groupDetails.GroupMembers);
            AssertUserListsEqual(
                new List <User> {
                new User(notMember), new User(user)
            }, groupDetails.UserGlobalList
                );
        }
Esempio n. 22
0
 protected void GetData()
 {
     UserData model = new UserDataManager().GetModel(this.userName);
     this.addUserBtn.Enabled = true;
     if ((model == null) || !model.isSenhe)
     {
         this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('请退出重新登录后再操作');", true);
     }
     else
     {
         List<ManaData> list = new ManaDataManager().GetList(model.userName);
         this.DropDownList2.Items.Clear();
         foreach (ManaData data2 in list)
         {
             this.DropDownList2.Items.Add(new ListItem(data2.manaNum, data2.manaNum));
         }
         this.ficitLb.Text = model.zhuceMoney.ToString("F2");
         this.lastMoneyLb.Text = model.lastMoney.ToString("F2");
         this.GetNewGroup(list[0].manaNum);
         if (model.isKou == 0)
         {
             this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('您是空单,不能升级');", true);
             this.addUserBtn.Enabled = false;
         }
     }
 }
Esempio n. 23
0
 public void happyNewMonth()
 {
     if (UserDataManager.GetInstance().gold.inRed())
     {
         ++m_monthsInRed;
         if (b_warningInRedPopupShown)
         {
             ++m_monthsSinceIShowedInRedPopup;
         }
         if (m_monthsInRed >= MONTHS_TO_LOSE)
         {
             instantiateLostPanel();
         }
         else if (!b_warningInRedPopupShown || m_monthsSinceIShowedInRedPopup >= MONTHS_UNTIL_SHOWING_PANEL)
         {
             instantiateWarningInRedPanel();
             m_monthsSinceIShowedInRedPopup = 0;
             b_warningInRedPopupShown       = true;
         }
     }
     else
     {
         m_monthsInRed = 0;
     }
 }
Esempio n. 24
0
        private async void  login_button_click(object sender, RoutedEventArgs e)
        {
            if (TxtUsername.Text == "")
            {
                _message.Message.Text = "Please Enter Username";
                TxtUsername.Focus();
                await DialogHost.Show(_message, "RootDialog");

                return;
            }
            if (TxtPassword.Password == "")
            {
                _message.Message.Text = "Please Enter Password";
                TxtPassword.Focus();
                await DialogHost.Show(_message, "RootDialog");

                return;
            }
            UserDataManager userManager = new UserDataManager();
            User            user        = userManager.AuthenticateUser(TxtUsername.Text, TxtPassword.Password);

            if (user == null)
            {
                _message.Message.Text = "Wrong username or password";
                TxtUsername.Focus();
                await DialogHost.Show(_message, "RootDialog");

                return;
            }
            MainWindow window = new MainWindow();

            window.Show();
            Close();
        }
Esempio n. 25
0
 public void ClearSettings()
 {
     UserDataManager.SetTestHomeDirectory(_testFilePath);
     ApplicationSettings.ClearAllParameters();
     UserDataManager.DeleteSaveSummaryFile();
     UserDataManager.SetupDirectoriesAndFiles();
 }
Esempio n. 26
0
        public ValueGroup CalculateLastSeenMovies()
        {
            var viewedMovies = GetAllViewedMoviesByUser()
                               .OrderByDescending(
                m =>
                UserDataManager.GetUserData(
                    User ??
                    UserManager.Users.FirstOrDefault <User>(u => m.IsPlayed(u) && UserDataManager.GetUserData(u, m).LastPlayedDate.HasValue), m)
                .LastPlayedDate)
                               .Take(8).ToList();

            var lastSeenList = viewedMovies
                               .Select(item => new LastSeenModel
            {
                Name     = item.Name,
                Played   = UserDataManager.GetUserData(User, item).LastPlayedDate?.DateTime ?? DateTime.MinValue,
                UserName = null
            }.ToString()).ToList();

            return(new ValueGroup
            {
                Title = Constants.LastSeenMovies,
                ValueLineOne = string.Join("<br/>", lastSeenList),
                ValueLineTwo = "",
                Size = "large"
            });
        }
Esempio n. 27
0
    void Start()
    {
        userDataManager = UserDataManager.ins;
        if (userDataManager == null)
        {
            Debug.LogError("No UserDataManager found");
        }
        courseManager = CourseManager.ins;
        if (courseManager == null)
        {
            Debug.LogError("No CourseManager found");
        }

        modalPanel = ModalPanel.ins;
        yesQuitAction = new UnityAction(_QuitAndSave);
        noQuitAction = new UnityAction(_DoNothing);
        yesReloadCourseViewScene = new UnityAction(_ReloadCourseViewScene);
        noReloadCourseViewScene = new UnityAction(_DoNothing);

        fade = Fade.ins;
        if (fade == null)
        {
            Debug.LogError("No Fade found");
        }
    }
Esempio n. 28
0
        /// <summary>
        /// Adds input amount to user balance
        /// </summary>
        /// <param name="context">This is the user, typically the sender</param>
        /// <param name="addAmount">Amount to add</param>
        /// <param name="deductTaxes">Whether or not deduct taxes from the add amount, tax rate is set in FinanceConfigValues</param>
        /// <returns></returns>
        public static bool AddCredits(SocketCommandContext context, long addAmount, bool deductTaxes = false)
        {
            //Get user credit storage
            var userStorage = UserDataManager.GetUserStorage();

            //Check if user has sufficient credits
            if (GetUserCredits(context) + addAmount > 0)
            {
                //Calculate new credits
                long userCreditsNew = 0;
                if (deductTaxes == true)
                {
                    userCreditsNew = userStorage.UserInfo[context.Message.Author.Id].UserBankingStorage.Credit + addAmount - UserCreditsTaxHandler.TaxCollector(addAmount);
                }
                else if (deductTaxes == false)
                {
                    userCreditsNew = userStorage.UserInfo[context.Message.Author.Id].UserBankingStorage.Credit + addAmount;
                }

                userStorage.UserInfo[context.Message.Author.Id].UserBankingStorage.Credit = userCreditsNew;

                //Write new credits amount
                UserDataManager.WriteUserStorage(userStorage);

                return(true);
            }
            else
            {
                //False to indicate that user does not have enough credits to be deducted
                return(false);
            }
        }
Esempio n. 29
0
    override public void newDayCallback()
    {
        if (!b_IsProductionStopped)
        {
            uint riceToPrepare = Math.Min(riceUnprepared, (uint)getCapacity2());
            riceUnprepared -= riceToPrepare;
            UserDataManager.GetInstance().sellRice(riceToPrepare);

            STATE newState;
            float filledRate = riceUnprepared / (float)getCapacity1();

            if (filledRate < 0.002)
            {
                newState = STATE.EMPTY;
            }
            else if (filledRate < 0.8)
            {
                newState = STATE.HALF;
            }
            else
            {
                newState = STATE.FULL;
            }

            if (_state != newState)
            {
                changeToState(newState);
            }
            //Debug.Log ("Building_Silo: filledRate=" + filledRate + " (" + newState + ")");
        }
    }
Esempio n. 30
0
	void Start()
	{
		if (courseListObject == null)
		{
			Debug.LogError("No courseListObject referenced");
		}
		if (courseDisplayPrefab == null)
		{
			Debug.LogError("No courseDisplayPrefab referenced");
		}
		if (welcome == null)
		{
			Debug.LogError("No welcome object referenced");
		}

		// Course manager
		courseManager = CourseManager.ins;
		if (courseManager == null)
		{
			Debug.LogError("No CourseManager?");
		}

		// User data manager
		userDataManager = UserDataManager.ins;
		if (userDataManager == null)
		{
			Debug.LogError("No UserDataManager?");
		}

		LoadCoursesIntoList();
		LoadUserInfo();
	}
Esempio n. 31
0
        /// <summary>
        /// Adds input amount to user balance
        /// </summary>
        /// <param name="Context">Used to determine channel to send messages to if necessary</param>
        /// <param name="guildID">Guild ID where the target user is in</param>
        /// <param name="userID">Target user ID</param>
        /// <param name="addAmount">Amount to add</param>
        /// <param name="deductTaxes">Whether or not deduct taxes from the add amount, tax rate is set in FinaceConfigValues</param>
        /// <returns></returns>
        public static bool AddCredits(SocketCommandContext Context, ulong userID, long addAmount, bool deductTaxes = false)
        {
            //Get user credits
            var userStorage = UserDataManager.GetUserStorage();

            //Check if user has sufficient credits
            if (GetUserCredits(Context) + addAmount > 0)
            {
                //Calculate new credits
                long userCreditsNew = 0;
                if (deductTaxes == true)
                {
                    userCreditsNew = userStorage.UserInfo[userID].UserBankingStorage.Credit + addAmount - UserCreditsTaxHandler.TaxCollector(addAmount);
                }
                else if (deductTaxes == false)
                {
                    userCreditsNew = userStorage.UserInfo[userID].UserBankingStorage.Credit + addAmount;
                }

                userStorage.UserInfo[userID].UserBankingStorage.Credit = userCreditsNew;

                //Write new credits amount
                UserDataManager.WriteUserStorage(userStorage);

                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 32
0
        public NotificationSettingsEmbed(SocketCommandContext ctx)
        {
            SetCtx(ctx);

            Settings = UserDataManager.GetUserSettings(BotUtils.GetGUser(ctx));

            AddMenuOptions(ReactionHandler.SELECT, ReactionHandler.UP, ReactionHandler.DOWN, ReactionHandler.DONE);
        }
Esempio n. 33
0
    // ---AUX ---
    private void upgradeBuilding(BUILDINGS buildingType)
    {
        Building    b           = BuildingsManager.GetInstance().getBuilding(buildingType);
        GoldReserve goldReserve = UserDataManager.GetInstance().gold;

        goldReserve.espendGold(b.getNextLevelCost());
        b.upgrade();
    }
Esempio n. 34
0
        public ShopEmbed(SocketCommandContext ctx)
        {
            SetCtx(ctx);

            Customer = UserDataManager.GetUserData(BotUtils.GetGUser(ctx));

            AddMenuOptions(ReactionHandler.SELECT, ReactionHandler.UP, ReactionHandler.DOWN, ReactionHandler.BACK);
        }
    override public void newDayCallback()
    {
        uint riceToPrepare = Math.Min(riceUnprepared, (uint)getCapacity2());

        riceUnprepared -= riceToPrepare;

        UserDataManager.GetInstance().sellRice(riceToPrepare);
    }
Esempio n. 36
0
 // Start is called before the first frame update
 void Start()
 {
     userDataManager = FindObjectOfType <UserDataManager>();
     if (userDataManager.PersonalData.PlayerName != "")
     {
         SceneSwitcher.GoToHomeScreen();
     }
 }
Esempio n. 37
0
 private void GetData()
 {
     string userName = this.Session["userName"].ToString();
     UserData model = new UserDataManager().GetModel(userName);
     this.lmlb.Text = model.lastMoney.ToString("F2");
     this.outlb.Text = new ZhuanZhangManager().GetFromMoneyByName(userName, 1).allMoney.ToString("F2");
     this.inlb.Text = new ZhuanZhangManager().GetToMoneyByName(userName, 1).allMoney.ToString("F2");
 }
Esempio n. 38
0
 private DataManager()
 {
     var database = new VCSEntities();
     userManager = new UserDataManager(database);
     repositoryManager = new RepositoryDataManager(database, this);
     fileManager = new FileDataManager(database);
     changeManager = new ChangeDataManager(database, this);
     commitManager = new CommitDataManager(database, this);
 }
Esempio n. 39
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     string pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(this.pwdtx1.Text.Trim(), "MD5");
     int num = new UserDataManager().ResetPwd(this.unLb.Text, pwd);
     if (new UserDataManager().ResetTwoPwd(this.unLb.Text, pwd) == 0)
     {
         this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('密码修改成功');window.location.href='" + base.Request.RawUrl + "';", true);
     }
 }
 protected void gvBlackList_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if(e.CommandName == "Remove")
     {
         UserDataManager userDataManager = new UserDataManager();
         var Arg = e.CommandArgument;
         userDataManager.RemoveFromBlackList(Convert.ToInt32(e.CommandArgument));
     }
     Response.Redirect(Request.RawUrl);
 }
Esempio n. 41
0
 public string BackName(string userName)
 {
     if (userName == "")
     {
         return "请输入会员账号进行查询。";
     }
     UserData model = new UserDataManager().GetModel(userName);
     if ((model != null) && model.isSenhe)
     {
         return ("姓名:" + model.realName + ";销售增值积分:" + model.guPiao.ToString());
     }
     return "您输入的账号不可用。";
 }
Esempio n. 42
0
	void Awake()
	{
		if (_ins == null)
		{
			// Populate with first instance
			_ins = this;
			DontDestroyOnLoad(this);
		}
		else
		{
			// Another instance exists, destroy
			if (this != _ins)
				Destroy(this.gameObject);
		}
	}
Esempio n. 43
0
 private void GetData()
 {
     UserData model = new UserDataManager().GetModel(this.userName);
     if (model == null)
     {
         base.Response.Write("<script type='text/javascript'>window.location.href='index.aspx';</script>");
     }
     else
     {
         this.lastMoneyLb.Text = model.lastMoney.ToString("F2");
         this.allTixianLb.Text = new TiXianManager().GetAllMoneyByName(this.userName, 1).allMonwy.ToString("F2");
         this.bankAddr.Text = model.bankAddr;
         this.batx.Text = model.bankName;
         this.butx.Text = model.bankNum;
         this.rltx.Text = model.realName;
     }
 }
        public VoipSession(UserDataManager userData)
        {
            _userData = userData;
            _nAudioTest = new AudioHardwareSession(Codec);
            _nAudioTest.InputDeviceNumber = App.Settings.AudioInputDeviceIndex;
            _nAudioTest.TriggerInput = _userData.Settings.MicTriggerInput;
            _nAudioTest.AudioRecorded += _nAudioTest_AudioRecorded;
            _nAudioTest.AudioRecordEnded += _nAudioTest_AudioRecordEnded;
            _nAudioTest.InputDeviceNumberChanged += _nAudioTest_InputDeviceNumberChanged;
            _nAudioTest.AudioSystemTick += _nAudioTest_AudioSystemTick;

            _udpKeepAliveTimer = new DispatcherTimer();
            _udpKeepAliveTimer.Interval = TimeSpan.FromSeconds(55);
            _udpKeepAliveTimer.Tick += _udpKeepAliveTimer_Tick;

            Connect();

            _micTrigger = SignalHelpers.ReadAudioResource("MicActivate.wav", Codec.RecordFormat);
        }
Esempio n. 45
0
 private void TopBind(string topName)
 {
     this.ReferrTree.Nodes.Clear();
     UserData model = new UserDataManager().GetModel(topName);
     TreeNode child = null;
     if (model.userName.ToLower() == this.userName.ToLower())
     {
         child = new TreeNode("<img src='../" + Mark.GetImgSrc(model.groupId) + "'/>&nbsp;" + model.userName + "&nbsp;[" + model.realName + "]", this.userName);
     }
     else
     {
         child = new TreeNode("<img src='../" + Mark.GetImgSrc(model.groupId) + "'/>&nbsp;" + model.userName + "&nbsp;[" + model.realName + "]", model.refName);
     }
     if (this.ReferrTree.SelectedNode == null)
     {
         this.ReferrTree.Nodes.Add(child);
     }
     this.bindChid(topName, child, 1);
     this.ReferrTree.DataBind();
 }
Esempio n. 46
0
 private void GetData()
 {
     decimal allMoney = new UserDataManager().GetAllMoney();
     List<DetailedAward> model = new DetailedAwardManager().GetModel();
     this.allMoneyLb.InnerHtml = allMoney.ToString("F2");
     if ((model.Count == 0) || (allMoney == 0M))
     {
         this.refAwardLb.InnerText = "0";
         this.pengAwardLb.InnerText = "0";
         this.refPengAwardLb.InnerText = "0";
         this.fenHongAwardLb.InnerText = "0";
         this.allAwardLb.InnerText = "0";
         this.kouOneLb.InnerText = "0";
         this.realAwardLb.InnerText = "0";
         this.refAwardPicLb.InnerText = "0";
         this.pengAwardPicLb.InnerText = "0";
         this.refPengAwardPicLb.InnerText = "0";
         this.fenHongAwardPicLb.InnerText = "0";
         this.allAwardPicLb.InnerText = "0";
         this.kouOnePicLb.InnerText = "0";
         this.realAwardPicLb.InnerText = "0";
     }
     else
     {
         this.refAwardLb.InnerText = model[0].refAward.ToString("F2");
         this.pengAwardLb.InnerText = model[0].pengAward.ToString("F2");
         this.refPengAwardLb.InnerText = model[0].refPengAward.ToString("F2");
         this.fenHongAwardLb.InnerText = model[0].fenHongAward.ToString("F2");
         this.allAwardLb.InnerText = model[0].allAward.ToString("F2");
         this.kouOneLb.InnerText = model[0].kouOne.ToString("F2");
         this.realAwardLb.InnerText = model[0].realAward.ToString("F2");
         this.refAwardPicLb.InnerText = ((model[0].refAward / allMoney) * 100M).ToString("F2");
         this.pengAwardPicLb.InnerText = ((model[0].pengAward / allMoney) * 100M).ToString("F2");
         this.refPengAwardPicLb.InnerText = ((model[0].refPengAward / allMoney) * 100M).ToString("F2");
         this.fenHongAwardPicLb.InnerText = ((model[0].fenHongAward / allMoney) * 100M).ToString("F2");
         this.allAwardPicLb.InnerText = ((model[0].allAward / allMoney) * 100M).ToString("F2");
         this.kouOnePicLb.InnerText = ((model[0].kouOne / allMoney) * 100M).ToString("F2");
         this.realAwardPicLb.InnerText = ((model[0].realAward / allMoney) * 100M).ToString("F2");
     }
 }
Esempio n. 47
0
 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         TiXian dataItem = (TiXian)e.Row.DataItem;
         e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#ECECEC'");
         e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
         e.Row.Cells[0].Text = dataItem.userName;
         e.Row.Cells[1].Text = dataItem.allMonwy.ToString("F2");
         e.Row.Cells[2].Text = dataItem.anyMoney.ToString("F2");
         e.Row.Cells[3].Text = dataItem.markTime.ToShortDateString();
         if (dataItem.isShenhe)
         {
             e.Row.Cells[4].Text = dataItem.overTime.ToShortDateString();
         }
         else
         {
             e.Row.Cells[4].Text = "&nbsp;";
         }
         UserData model = new UserDataManager().GetModel(dataItem.userName);
         e.Row.Cells[5].Text = model.bankAddr;
         e.Row.Cells[6].Text = model.bankName;
         e.Row.Cells[7].Text = model.bankNum;
         e.Row.Cells[8].Text = model.realName;
         if (dataItem.isShenhe)
         {
             e.Row.Cells[9].Text = "已发放";
         }
         else
         {
             e.Row.Cells[9].Text = "待发放";
         }
     }
 }
Esempio n. 48
0
 private void GetData()
 {
     UserData model = new UserDataManager().GetModel(this.Id);
     this.unLb.Text = model.userName;
     this.rfLb.Text = model.refName;
     this.realtx.Text = model.realName;
     this.baLb.Text = model.bankName;
     this.buLb.Text = model.bankNum;
     this.phtx.Text = model.phone;
     this.topLb.Text = model.fenGroup.ToString("F2");
     this.pidTx.Text = model.pid;
     this.bankAddrTx.Text = model.bankAddr;
     this.qqNumTx.Text = model.qqNum;
     this.addtx.Text = model.address;
     this.zipTx.Text = model.zip;
     this.niChengTx.Text = model.niCheng;
     this.topNameLb.Text = new ManaDataManager().GetModel(model.userName).topName;
     this.groupLb.Text = Mark.GetGroupName(model.groupId);
     this.regNameLb.Text = model.regName;
     this.lastMoney.Text = model.lastMoney.ToString("F2");
     this.ficit.Text = model.zhuceMoney.ToString("F2");
     this.jiaoyiLb.Text = model.cfMoney.ToString("F2");
     this.gupiaoLb.Text = model.guPiao.ToString();
     model = null;
 }
Esempio n. 49
0
 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         TiXian dataItem = (TiXian)e.Row.DataItem;
         UserData model = new UserDataManager().GetModel(dataItem.userName);
         e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#FFF6D0'");
         e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
         e.Row.Cells[0].Text = dataItem.userName;
         e.Row.Cells[1].Text = model.realName;
         e.Row.Cells[2].Text = dataItem.allMonwy.ToString("F2");
         e.Row.Cells[3].Text = dataItem.anyMoney.ToString("F2");
         e.Row.Cells[8].Text = dataItem.markTime.ToShortDateString();
         if (dataItem.isShenhe)
         {
             e.Row.Cells[9].Text = dataItem.overTime.ToShortDateString();
         }
         else
         {
             e.Row.Cells[9].Text = "&nbsp;";
         }
         e.Row.Cells[4].Text = model.bankAddr;
         e.Row.Cells[5].Text = model.bankName;
         e.Row.Cells[6].Text = model.bankNum + ",";
         e.Row.Cells[7].Text = model.phone;
         if (dataItem.isShenhe)
         {
             e.Row.Cells[10].Text = "已发";
         }
         else
         {
             LinkButton button = (LinkButton)e.Row.FindControl("toShenHe");
             button.ToolTip = dataItem.id.ToString();
             button.Attributes.Add("onclick", "return toSen()");
         }
     }
 }
Esempio n. 50
0
 private void GetData()
 {
     UserData model = new UserDataManager().GetModel(this.userName);
     if ((model == null) || !model.isSenhe)
     {
         this.Session["userName"] = null;
         base.Response.Write("<script type='text/javascript'>window.location.href='index.aspx';</script>");
     }
     else
     {
         decimal guPiao = new SysSetManager().GetModel().guPiao;
         int noCountByName = new StockPayLogManager().GetNoCountByName(this.userName);
         this.noPayNumLb.Text = noCountByName.ToString();
         this.payNumLb.Text = model.guPiao.ToString();
         int num3 = model.guPiao + noCountByName;
         this.allNumLb.Text = num3.ToString();
         this.allStockMoneyLb.Text = (num3 * guPiao).ToString("F2");
         this.ficitLb.Text = model.cfMoney.ToString("F2");
         this.overGpLb.Text = model.noMoney.ToString();
         this.OutMoneyList.Items.Clear();
         this.InMoneyList.Items.Clear();
         this.OutMoneyList.Items.Add(new ListItem("最佳现货价格", guPiao.ToString("F2")));
         this.InMoneyList.Items.Add(new ListItem("最佳现货价格", guPiao.ToString("F2")));
         for (int i = 0; i < 40; i++)
         {
             string text = (guPiao + (i * 0.005M)).ToString("F2");
             this.OutMoneyList.Items.Add(new ListItem(text, text));
             this.InMoneyList.Items.Add(new ListItem(text, text));
         }
         this.GetOutList();
         this.GetInList();
     }
 }
Esempio n. 51
0
        public void Update(UserDataManager manager, POCO.MatchPoco poco)
        {
            Id = poco._id;
            MatchHash = poco.match_hash;
            GameId = poco.game_id;
            RoomId = poco.room_id;
            RoomType = poco.room_type;
            IsBetting = poco.betting;
            Map = poco.map;

            if (poco.state == "new")
                State = MatchState.created;
            else if (poco.state == "started")
                State = MatchState.started;
            else if (poco.state == "cancelled")
                State = MatchState.canceled;
            else if (poco.state == "finalized")
                State = MatchState.finalized;
            else
            {
                State = MatchState.invalid;
                throw new Exception("Unrecognized state: " + poco.state);
            }

            Player1 = GetBetOperand(manager, poco.player_1_type, poco.player_1_id, poco.player_1_name);
            Player2 = GetBetOperand(manager, poco.player_2_type, poco.player_2_id, poco.player_2_name);

            if (string.IsNullOrWhiteSpace(poco.winner_id))
                Winner = null;
            else
            {
                if (poco.winner_id == Player1.Id)
                    Winner = Player1;
                else if (poco.winner_id == Player2.Id)
                    Winner = Player2;
            }
        }
        protected void gvClients_OnRowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Modify")
            {
                var clientManager = new ClientManager();
                currentId = Convert.ToInt32(e.CommandArgument);
                var client = clientManager.Get(currentId);
                fvRestaurateur.ChangeMode(FormViewMode.Edit);
                var src = new List<ClientInfo>();
                src.Add(client);
                fvRestaurateur.DataSource = src;
                fvRestaurateur.DataBind();
                PopupHelper.ShowPopup("#pop",this);
            }
            if(e.CommandName == "ToBlackLst")
            {
                var userManager = new UserDataManager();

                var user = userManager.GetById(Convert.ToInt32(e.CommandArgument));
                userManager.SetToBlackList(user);
            }
        }
        protected void GridView1_OnRowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "ToBlackLst")
            {

                var userManager = new UserDataManager();

                var user = userManager.GetById(Convert.ToInt32(e.CommandArgument));
                userManager.SetToBlackList(user);
                Response.Redirect(Request.RawUrl);
            }
        }
Esempio n. 54
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Session["userName"] == null)
     {
         base.Response.Write("<script type='text/javascript'>window.location.href='index.aspx';</script>");
     }
     else if (this.Session["twoLogin"] == null)
     {
         this.Session["PostBack"] = base.Request.RawUrl;
         base.Response.Write("<script type='text/javascript'>window.location.replace('TwoLogin.aspx');</script>");
     }
     else if (!base.IsPostBack)
     {
         string userName = "";
         int num = 0;
         try
         {
             userName = Convert.ToString(base.Request.QueryString["tn"]);
             num = Convert.ToInt32(base.Request.QueryString["il"]);
         }
         catch
         {
             userName = "";
             num = 0;
         }
         this.regName = this.Session["userName"].ToString();
         UserData model = new UserDataManager().GetModel(this.regName);
         Random random = new Random();
         int num2 = random.Next(0x186a1, 0xf423f);
         while (new UserDataManager().GetModel("cn" + num2.ToString()) != null)
         {
             num2 = random.Next(0x186a1, 0xf423f);
         }
         this.untx.Value = "cn" + num2.ToString();
         this.rntx.Value = model.userName;
         if (new UserDataManager().GetModel(userName) != null)
         {
             this.topTx.Value = userName;
         }
         this.RadioButtonList1.SelectedValue = num.ToString();
     }
 }
Esempio n. 55
0
    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void addUserBtn_Click(object sender, EventArgs e)
    {
        string bankAddr = this.bankAddr.Value.Trim();
        string userName = this.untx.Value.Trim();
        string password = this.pstx1.Value.Trim();
        string str4 = this.pstx3.Value.Trim();
        string refName = this.rntx.Value.Trim();
        string selectedValue = this.DropDownList2.SelectedValue;
        string bankNum = this.butx.Value.Trim();
        string realName = this.realtx.Value.Trim();
        string phone = this.phtx.Value.Trim();
        string address = this.addtx.Value.Trim();
        string zip = this.zipTx.Value.Trim();
        string pid = this.pidTx.Value.Trim();
        string qqNum = this.qqNumTx.Value.Trim();
        string niCheng = this.niChengTx.Value.Trim();
        int groupId = Convert.ToInt32(this.DropDownList1.SelectedValue);
        int isLeft = Convert.ToInt32(this.RadioButtonList1.SelectedValue);
        string topName = this.topTx.Value.Trim();
        password = FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5");
        str4 = FormsAuthentication.HashPasswordForStoringInConfigFile(str4, "MD5");
        int num3 = new UserDataManager().AddModel(userName, password, str4, address, pid, phone, selectedValue, bankNum, realName, refName, bankAddr, zip, qqNum, niCheng, topName, isLeft, groupId, this.regName, 1);
        Random random = new Random();
        int num4 = random.Next(0x186a1, 0xf423f);
        while (new UserDataManager().GetModel("cn" + num4.ToString()) != null)
        {
            num4 = random.Next(0x186a1, 0xf423f);
        }
        switch (num3)
        {
            case 0:
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('数据库繁忙,请重试');", true);
                return;

            case 1:
                this.untx.Value = "cn" + num4.ToString();
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('注册成功');window.location.href='u_dailiMark.aspx';", true);
                return;

            case 2:
                this.untx.Value = "cn" + num4.ToString();
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('账号已存在');", true);
                return;

            case 3:
                this.rntx.Value = "";
                this.rntx.Focus();
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('推荐人不存在');", true);
                return;

            case 5:
                this.topTx.Value = "";
                this.topTx.Focus();
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('安置人不可用');", true);
                return;

            case 6:
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('所选分区已满');", true);
                return;

            case 7:
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('注册失败,请退出重新登录');", true);
                return;
        }
        this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('数据库繁忙,请重试');", true);
    }
Esempio n. 56
0
    protected void ToSen_Click(object sender, EventArgs e)
    {
        string toolTip = ((LinkButton)sender).ToolTip;
        switch (new UserDataManager().Senhe(toolTip))
        {
            case 1:
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('审核成功');", true);
                break;

            case 2:
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('会员已审核或不存在');", true);
                break;

            case 3:
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "alert('您的注册钱包不足');", true);
                break;
        }
        UserData model = new UserDataManager().GetModel(this.dailiNum);
        this.ShowMsg.InnerHtml = "您的现金钱包" + model.lastMoney.ToString("F2") + ",注册钱包:" + model.zhuceMoney.ToString("F2");
        this.AllCount = new UserDataManager().GetListByRegName(this.dailiNum, this.State).Count;
        this.AllPage = ((this.AllCount % this.PageCount) > 0) ? ((this.AllCount / this.PageCount) + 1) : (this.AllCount / this.PageCount);
        this.NowPage = (this.NowPage > this.AllPage) ? this.AllPage : this.NowPage;
        this.GetData();
    }
Esempio n. 57
0
        private static IBetOperand GetBetOperand(UserDataManager manager, string type, string id, string name)
        {
            if (id == null) return null;

            IBetOperand player = null;
            if (type == "Team")
            {
                player = manager.GetPgTeam(new POCO.TeamBase { _id = id, name = name });
            }
            else if (type == "User")
            {
                player = manager.GetPgUser(new POCO.UserBase { _id = id, username = name });
            }
            else
                throw new Exception("Player type " + type + " not recognized.");
            return player;
        }
Esempio n. 58
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Session["userName"] == null)
     {
         base.Response.Write("<script type='text/javascript'>window.location.href='index.aspx';</script>");
     }
     else if (this.Session["twoLogin"] == null)
     {
         this.Session["PostBack"] = "u_dailiMark.aspx";
         base.Response.Write("<script type='text/javascript'>window.location.replace('TwoLogin.aspx');</script>");
     }
     else if (!base.IsPostBack)
     {
         this.dailiNum = this.Session["userName"].ToString();
         UserData model = new UserDataManager().GetModel(this.dailiNum);
         this.ShowMsg.InnerHtml = "您的现金钱包" + model.lastMoney.ToString("F2") + ",注册钱包:" + model.zhuceMoney.ToString("F2");
         this.AllCount = new UserDataManager().GetListByRegName(this.dailiNum, this.State).Count;
         this.AllPage = ((this.AllCount % this.PageCount) > 0) ? ((this.AllCount / this.PageCount) + 1) : (this.AllCount / this.PageCount);
         this.NowPage = 1;
         this.GetData();
     }
 }
 public static void LookupGameRoom(UserDataManager userData, string id, Action<GameRoomItem> onLookupResponse)
 {
     RestResponse<GameRoomSinglePoco> response = null;
     userData.PgSession.BeginAndCallback(delegate
     {
         var url = userData.PgSession.GetWebAppFunction("/api", "/game_rooms/" + id, "include_bets=true");
         var client = new RestClient(url);
         var request = new RestRequest(Method.GET);
         response = (RestResponse<GameRoomSinglePoco>)client.Execute<GameRoomSinglePoco>(request);
     }, delegate
     {
         if (response.IsOk())
         {
             var gameRoom = response.Data.game_room;
             var item = new GameRoomItem(gameRoom);
             if (onLookupResponse != null)
                 onLookupResponse(item);
         }
     });
 }