Example #1
0
        //used according to the cell that is selected to navigateTo to the new PrincipalPage used to show the detailed information of the account selected
        private async void NavigateTo(Accounts.Account account)
        {
            if (account == null)
            {
                return;
            }

            //Account id, bank id and HREF that will be called in other future page
            Accountid = account.id;
            Debug.WriteLine("accountid in accountpage {0}", Accountid);
            Bankid = account.bank_id;
            Debug.WriteLine("bankid in accountpage {0}", Bankid);
            Href = account._links.detail.href;
            Debug.WriteLine("href in accountpage {0}", Href);

            try
            {
                //Navigation to the new page
                await Navigation.PushAsync(new PrincipalPage());
            }
            catch (Exception err)
            {
                Debug.WriteLine("Caught error transactionpage: {0}.", err);
            }
        }
Example #2
0
        public void Arrange()
        {
            _fixture = new Fixture();

            _collectionYear = _fixture.Create <short>();


            _collectionPeriod = new CollectionPeriod(1, _collectionYear);

            _accountLegalEntityId = _fixture.Create <long>();
            _account = Accounts.Account.Create(_fixture.Build <AccountModel>().Without(a => a.LegalEntityModels).Create());

            var startDate = DateTime.Now.Date;
            var dueDate   = startDate.AddDays(90).Date;

            _sutModel = _fixture
                        .Build <ApprenticeshipIncentiveModel>()
                        .With(a => a.Account, new Account(_account.Id, _accountLegalEntityId))
                        .With(a => a.StartDate, startDate)
                        .With(a => a.PendingPaymentModels, new List <PendingPaymentModel>()
            {
                _fixture.Build <PendingPaymentModel>()
                .With(p => p.DueDate, dueDate)
                .With(p => p.PendingPaymentValidationResultModels, new List <PendingPaymentValidationResultModel>())
                .With(p => p.Account, new Account(_account.Id, _accountLegalEntityId))
                .Create()
            })
                        .Create();

            _sutModel.Apprenticeship.SetProvider(_fixture.Create <Provider>());

            _sut = Sut(_sutModel);
        }
Example #3
0
        /// <summary>
        /// Logins this instance.
        /// </summary>
        internal void Login(Accounts.Account Account)
        {
            if (this.Device.ReceiveEncrypter.IsRC4)
            {
                new Encryption_Message(this.Device, this.Seed).Send();
            }

            new Authentification_Ok_Message(this.Device).Send();

            return;

            new Own_Home_Data_Message(this.Device, Account.Home, Account.Player, TimeUtil.Timestamp, 0).Send();
            new Avatar_Stream_Message(this.Device, this.Device.GameMode.Level.Player.Logs).Send();

            if (this.Device.GameMode.Level.Player.InAlliance)
            {
                new Alliance_Stream_Message(this.Device, this.Device.GameMode.Level.Player.Alliance.Streams.Slots.Values.ToArray()).Send();
                this.Device.GameMode.Level.Player.Alliance.Members.Connected.TryAdd(this.Device.GameMode.Level.Player.PlayerID, this.Device.GameMode.Level.Player);
            }

            if (this.Device.Chat == null)
            {
                Resources.Chats.Join(this.Device);
            }
        }
        public ActionResult Index()
        {
            if (!Request.IsAuthenticated)
            {
                return(Redirect(Url.Action("Index", "Login")));
            }
            HttpCookie authcookie = Request.Cookies[".PixieCookie"];

            Accounts.Account account = jsserializer.Deserialize <Accounts.Account>(Helpers.GetFormsAuthenticationCookie());

            HomeModel m = new HomeModel();

            return(View(m));
        }
Example #5
0
        public void ValidatePendingPaymentBankDetails(Guid pendingPaymentId, Accounts.Account account, CollectionPeriod collectionPeriod)
        {
            if (Account.Id != account.Id)
            {
                throw new InvalidPendingPaymentException($"Unable to validate PendingPayment {pendingPaymentId} of ApprenticeshipIncentive {Model.Id} because the provided Account record does not match the one against the incentive.");
            }

            var pendingPayment = GetPendingPaymentForValidationCheck(pendingPaymentId);

            var legalEntity = account.GetLegalEntity(pendingPayment.Account.AccountLegalEntityId);

            var isValid = !string.IsNullOrEmpty(legalEntity.VrfVendorId);

            pendingPayment.AddValidationResult(PendingPaymentValidationResult.New(Guid.NewGuid(), collectionPeriod, ValidationStep.HasBankDetails, isValid));
        }
        public void ValidateMinimumRequiredAgreementVersion(Guid pendingPaymentId, Accounts.Account account, CollectionPeriod collectionPeriod)
        {
            if (account == null || Account.Id != account.Id)
            {
                throw new InvalidPendingPaymentException($"Unable to validate PendingPayment {pendingPaymentId} of ApprenticeshipIncentive {Model.Id} because the provided Account record does not match the one against the incentive.");
            }

            var pendingPayment = GetPendingPaymentForValidationCheck(pendingPaymentId);

            var legalEntity = account.GetLegalEntity(pendingPayment.Account.AccountLegalEntityId);

            var isValid = legalEntity.SignedAgreementVersion >= MinimumAgreementVersion.MinimumRequiredVersion;

            pendingPayment.AddValidationResult(PendingPaymentValidationResult.New(Guid.NewGuid(), collectionPeriod, ValidationStep.HasSignedMinVersion, isValid));
        }
Example #7
0
        public AccountBan CreateAccountBan(Accounts.Account acc, string notes, DateTime?expiry)
        {
            Contract.Requires(acc != null);
            Contract.Ensures(Contract.Result <AccountBan>() != null);

            var rec = new AccountBanRecord(acc.Record)
            {
                Notes  = notes,
                Expiry = expiry,
            };

            rec.Create();

            var ban = new AccountBan(rec);

            AddAccountBan(ban);
            return(ban);
        }
Example #8
0
        public static async Task Login(Accounts.Account account)
        {
            var req = new HttpRequestMessage()
            {
                RequestUri = new Uri("https://accounts.nexon.net/account/login/launcher"),
                Method     = HttpMethod.Post,
                Content    = new StringContent($"{{\"id\":\"{account.Username}\",\"password\":\"{account.Token}\",\"auto_login\":false,\"client_id\":\"{CLIENT_ID}\",\"scope\":\"{SCOPE}\",\"device_id\":\"{DeviceId}\"}}", Encoding.UTF8, "application/json")
            };

            req.Headers.Add("User-Agent", "NexonLauncher node-webkit/0.14.6 (Windows NT 10.0; WOW64) WebKit/537.36 (@c26c0312e940221c424c2730ef72be2c69ac1b67) nexon_client");
            req.Headers.Add("Origin", "chrome-extension://dobbaijafcbikgimjpakclacfgeagffm");

            HttpResponseMessage res = await Client.SendAsync(req);

            dynamic json = await ParseResponseJson(res);

            accessToken = json["access_token"];
            ClientCookies.Add(new Cookie("nxtk", accessToken, "/", ".nexon.net")); // this cookie is used in all future requests
        }
        protected virtual JobBudget _FindByJobAccount(Job _job, Accounts.Account acc)
        {
            JobBudget         _jb    = null;
            DbSelectStatement clause = DbMgr.CreateSelectClause();

            clause.SelectAll().From("JobBudgets").Criteria
            .IsEqual("JobBudgets", "JobID", _job.JobID)
            .IsEqual("JobBudgets", "AccountID", acc.AccountID);


            DbCommand    _cmd    = CreateDbCommand(clause);
            DbDataReader _reader = _cmd.ExecuteReader();

            if (_reader.Read())
            {
                _jb = CreateDbEntity();
                LoadFromReader(_jb, _reader);
            }
            _reader.Close();
            _cmd.Dispose();

            return(_jb);
        }
Example #10
0
        /// <summary>
        /// Processes this message.
        /// </summary>
        internal override void Process()
        {
            if (this.Trusted())
            {
                if (this.LowID == 0)
                {
                    Accounts.Account Account = Resources.Accounts.CreateAccount();

                    if (Account.Player != null && Account.Home != null)
                    {
                        this.Login(Account);
                    }
                    else
                    {
                        new Authentification_Failed_Message(this.Device, Reason.Pause).Send();
                    }
                }
                else if (this.LowID > 0)
                {
                    Accounts.Account Account = Resources.Accounts.LoadAccount(this.HighID, this.LowID, this.PassToken);

                    if (Account.Player != null && Account.Home != null)
                    {
                        this.Login(Account);
                    }
                    else
                    {
                        new Authentification_Failed_Message(this.Device, Reason.Reset).Send();
                    }
                }
                else
                {
                    Logging.Error(this.GetType(), this.Device, "Player tried to login with a player id inferior to 0.");
                }
            }
        }
 public JobBudget FindByJobAccount(Job _job, Accounts.Account acc)
 {
     return(_FindByJobAccount(_job, acc));
 }
Example #12
0
        public ActionResult Index(LoginModel lm)
        {
            string returnUrl = "";

            if (TempData["returnUrl"] != null)
            {
                returnUrl = TempData["returnUrl"].ToString();
                if (returnUrl.ToLower().Contains("logout"))
                {
                    returnUrl = "Home";
                }
            }
            else
            {
                returnUrl = lm.ReturnUrl;
            }

            if (!ModelState.IsValid)
            {
                ModelState.AddModelError("", "Username and Password is required.");
                lm.ReturnUrl = returnUrl;
                return(View(lm));
            }

            lm.Username = lm.Username.ToUpper().Trim();

            Accounts accnts = new Accounts();

            Accounts.Account accnt = accnts.SelectUserByUsername(lm.Username);

            if (accnt.Username == null)
            {
                ModelState.AddModelError("", "Username does not exist.");
                lm.ReturnUrl = returnUrl;
                return(View(lm));
            }

            string hashing = PRMS.GetMD5Hash(lm.Password);

            if (PRMS.GetMD5Hash(lm.Password) != accnt.Password)
            {
                ModelState.AddModelError("", "Password is incorrect.");
                return(View(lm));
            }
            else
            {
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                string data = serializer.Serialize(accnt);
                FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, lm.Username, DateTime.Now, DateTime.Now.AddHours(8), true, data, FormsAuthentication.FormsCookiePath);
                string           encriptedTicket = FormsAuthentication.Encrypt(ticket);
                HttpCookie       ticketCookie    = new HttpCookie(FormsAuthentication.FormsCookieName, encriptedTicket);
                Accounts.Account x = serializer.Deserialize <Accounts.Account>(data);
                Response.Cookies.Add(ticketCookie);

                Parameters.UserID       = accnt.ID;
                Parameters.UserName     = accnt.Name;
                Parameters.UsedUsername = accnt.Username;
                Parameters.Password     = accnt.Password;
                Parameters.Department   = accnt.DepartmentID;
                Parameters.Role         = accnt.RoleID;
                return(RedirectToAction("Index", "Home"));
            }
        }
 public JobAccount FindByJobAccount(Job _job, Accounts.Account _acc)
 {
     return(_FindByJobAccount(_job, _acc));
 }
 public static ChangeStatus(Accounts.Account a, MyTask t, Status s)
 {
 public static async Task <IResult> PerformProxyRequestAsync(this IWorkAccountApi api, GoogleApiClient client, Accounts.Account account)
 {
     return((await api.RemoveWorkAccount(client, account)).JavaCast <IResult>());
 }