Exemplo n.º 1
0
        private void accountRechargeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var acc = new BaseRepository <Account>().Get(a => a.User.Id == CurrentUserId).FirstOrDefault();

            if (acc?.IsActiveStatus == false)
            {
                MessageContainer.DisplayError("Account is diactivated!" + Environment.NewLine +
                                              "Please connect to administrator", "Attention!!!");
                return;
            }

            var actions = new AccountChargeForm(CurrentUserId)
            {
                Text = @"Account recharge",
                //copy icons folder to ...//TvForms/bin/Debug/icons - folder for icons
                Icon = new Icon(@"icons\mastercard_1450.ico")
            };

            this.ShowInTaskbar = false;
            actions.ShowDialog();
            this.ShowInTaskbar = true;

            var userType = new BaseRepository <User>().Get(u => u.Id == CurrentUserId).FirstOrDefault()?.UserType.Id;

            if (userType == (int)EUserType.CLIENT)
            {
                _userWindow.SetReloadMoneyButton(true, Color.Crimson);
            }
        }
Exemplo n.º 2
0
        private void btChargeAccount_Click(object sender, EventArgs e)
        {
            var acc = new BaseRepository <Account>().Get(a => a.User.Id == CurrentUserId).FirstOrDefault();

            if (acc?.IsActiveStatus == false)
            {
                MessageContainer.DisplayError("Account is diactivated!" + Environment.NewLine +
                                              "Please connect to administrator", "Attention!!!");
                return;
            }

            var actions = new AccountChargeForm(CurrentUserId)
            {
                Text = @"Account recharge",
                //copy icons folder to ...//TvForms/bin/Debug/icons - folder for icons
                Icon = new Icon(@"icons\mastercard_1450.ico")
            };

            if (ParentForm != null)
            {
                ParentForm.Visible = false;
                actions.ShowDialog();
                ParentForm.Visible = true;
            }
        }