public AsignarPremio(ValueController vc)
 {
     _valueController = vc;
 }
Пример #2
0
 public IndexModel(ValueController vc)
 {
     _valueController = vc;
 }
Пример #3
0
 private void Start()
 {
     weaponController = transform.GetComponent <WeaponController>();
     spellController  = transform.GetComponent <SpellController>();
     valueController  = transform.parent.GetComponentInChildren <ValueController>();
 }
Пример #4
0
        public async Task <ActionResult> Login(LoginViewModel model, string returnUrl)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            ApplicationUser user;
            bool            IsEmail = IsValidEmail(model.Email);

            if (IsEmail)
            {
                user = await UserManager.FindByEmailAsync(model.Email);
            }
            else
            {
                user = await UserManager.FindByNameAsync(model.Email);
            }

            //Session["ID"] = Session.SessionID;
            //if (user != null)
            //{
            //    if (!await UserManager.IsEmailConfirmedAsync(user.Id))
            //    {
            //        string callbackUrl = await SendEmailConfirmationTokenAsync(user.Id, "Confirm your account-Resend");
            //        ViewBag.errorMessage = "You must have a confirmed email to log on. please check your Email to confirm email.";
            //        return View("Error");
            //    }

            //}

            // Require the user to have a confirmed email before they can log on.
            //var user = await UserManager.FindByNameAsync(model.Email);
            if (user != null)
            {
                if (!await UserManager.IsEmailConfirmedAsync(user.Id))
                {
                    string callbackUrl = await SendEmailConfirmationTokenAsync(user.Id, "Confirm your account-Resend");

                    ViewBag.errorMessage = "You must have a confirmed email to log on.";
                    return(View("Error"));
                }
            }
            if (user == null)
            {
                ModelState.AddModelError("", "Please Enter Correct Email or Username.");
                return(View(model));
            }

            // This doesn't count login failures towards account lockout
            // To enable password failures to trigger account lockout, change to shouldLockout: true
            var result = await SignInManager.PasswordSignInAsync(user.UserName, model.Password, model.RememberMe, shouldLockout : false);

            switch (result)
            {
            case SignInStatus.Success:
                if (1 == 1)
                {
                    string res = "Hi, you are login with " + get();
                    // SendMail a = new Blockchaninaccounts.App_Start.SendMail();
                    SendMail.Mail(user.Email, res);
                }
                ValueController vc   = new ValueController();
                var             res1 = vc.PostAddress(user.Id);
                var             v    = GetNotification(user.Id);
                Session["Notification"]        = v as EmailNotification;
                SecurityCenterController.Email = user.Email;
                SecurityCenterController.Id    = user.Id;
                string Ip       = GetIPAddress();
                string Mac      = GetMacAddress();
                string location = null;
                Session["Email"]    = user.Email;
                Session["UserName"] = user.UserName;
                if (user.GoogleAuthetication == true)
                {
                    return(RedirectToAction("GoogleCodeVarification"));
                }



                return(RedirectToLocal(returnUrl, user.Id, Ip, Mac, location, user.Email));

            case SignInStatus.LockedOut:
                return(View("Lockout"));

            case SignInStatus.RequiresVerification:
                Session["Email"]               = user.Email;
                Session["UserName"]            = user.UserName;
                SecurityCenterController.Email = user.Email;
                SecurityCenterController.Id    = user.Id;
                return(RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }));

            case SignInStatus.Failure:
            default:
                ModelState.AddModelError("", "Please Enter Correct Password.");
                return(View(model));
            }
        }
Пример #5
0
 void OnPlayerEnergyValueChanged(ValueController vc)
 {
     energyText.text = string.Format ("{0}/{1}", vc.GetValue(), vc.levelLimits[0]);
     energyButton.interactable = vc.GetCurrLevel() >= 0;
 }
Пример #6
0
 public CrearModel(ValueController vc)
 {
     _valueController = vc;
 }
Пример #7
0
 void OnPlayerEnergyValueChanged(ValueController vc)
 {
     energyText.text           = string.Format("{0}/{1}", vc.GetValue(), vc.levelLimits[0]);
     energyButton.interactable = vc.GetCurrLevel() >= 0;
 }
Пример #8
0
        protected override void SpawnValueController_Late(Channel.Value newValue, int channelIndex, ValueController controller)
        {
            var castController = (EditorValueController)controller;

            castController.OnRequestRotate.AddListener(() => OnRequestValueRotate?.Invoke(channelIndex));  // Removed in controller's OnDestroy().
        }