internal static Account GetAccountFromSession(IDictionary session) { Account account = session["stored.account"] as Account; if (account == null) { account = new Account(); session["stored.account"] = account; } return account; }
private IList ValidateAccount(Account account) { IList errors = new ArrayList(); if (account.Name == null || account.Name.Length == 0) { errors.Add("Full name field must be filled"); } if (account.Username == null || account.Username.Length == 0) { errors.Add("User name field must be filled"); } if (account.Email == null || account.Email.Length == 0) { errors.Add("E-mail field must be filled"); } if (account.Pwd != account.PwdConfirmation) { errors.Add("Password don't match with confirmation"); } return errors; }