public SignUpView() { InitializeComponent(); var signUpManager = new SignUpManager(); DataContext = signUpManager; }
public ActionResult SignUp(string email) { var isValid = new EmailAddressAttribute(); if (isValid.IsValid(email)) { var model = new SignupModel() { Brand = this.CurrentBrand, Email = email, EntryDate = DateTimeOffset.UtcNow }; var ok = SignUpManager.SignUp(model); if (ok) { return(RedirectToAction("ThankYou")); } return(new EmptyResult()); } else { return(new EmptyResult()); } }
static void Main(string[] args) { //ICustomer customer = new Student(); ICustomer adult = new Adult() { Id = "12345", FirstName = "Sude", LastName = "Sude", BirthYear = 1988, StudentId = "8888" }; ISignUpManager signUpManager = new SignUpManager(new StudentServiceAdapter()); signUpManager.CustomerAdd(new Student { Id = "12342153", FirstName = "Deniz", LastName = "Dinler", BirthYear = 2003, StudentId = "8888" }, new OracleServerDal()); signUpManager.CustomerAdd(adult, new MySqlServerDal()); ICampaignManager campaignManager = new CampaignManager(); ICampaign campaign1 = new Campaign() { EntityName = "GAME25" }; IGame game1 = new Game() { EntityName = "Doom2" }; campaignManager.AddCampaign(campaign1, game1, adult, new MySqlServerDal()); ISalesManager salesManager = new SalesManager(); salesManager.Sell(adult, game1, campaign1, new SMSLoggerService()); }
public IActionResult SignUp(SignUpPostData data) { if (ModelState.IsValid) { Person p = LoginManager.Login(data.username, data.password); if (p == null) //no existing user { p = SignUpManager.SignUp(data.username, data.password); HttpContext.Session.SetString("id", Convert.ToString(p.id)); HttpContext.Session.SetString("username", p.username); return(RedirectToAction("Main", "User")); } } ViewData["Title"] = "SignUp Failed"; return(View()); }
public void Setup() { string filePath = AppDomain.CurrentDomain.BaseDirectory + "user.dat"; _configurationManager = Substitute.For <ConfigurationManager>(filePath); var users = new Dictionary <string, string> { { "*****@*****.**", CryptographyController.EncryptPassword("bobLikesThaiFood") }, { "*****@*****.**", CryptographyController.EncryptPassword("stuartLikesThaiFood") }, { "*****@*****.**", CryptographyController.EncryptPassword("kevinLikesThaiFood") } }; _loginManager = Substitute.For <LoginManager>(users); _registrationManager = Substitute.For <RegistrationManager>(users); _signupManager = new SignUpManager(_loginManager, _registrationManager, _configurationManager, filePath); }
// Use this for initialization void Start() { instance = this; }
public SignUpUi() { InitializeComponent(); _signUpManager = new SignUpManager(); }