public void Method_testBarClient() { BarData barData = null; BazData bazData = null; BarClient barClient = null; if (barClient != null) { barClient.bar1(barData); barClient.bar3(barData); barClient.baz1(bazData); barClient.baz3(bazData); } BazClient bazClient = barClient; Bar bar = barClient; Baz baz = barClient; }
public void testFooClient() { FooData fooData = null; BarData barData = null; BazData bazData = null; FooClient fooClient = null; if (fooClient != null) { fooClient.foo1(fooData); fooClient.foo3(fooData); fooClient.bar1(barData); fooClient.bar3(barData); fooClient.baz1(bazData); fooClient.baz3(bazData); } BarClient barClient = fooClient; BazClient bazClient = fooClient; Foo foo = fooClient; Bar bar = fooClient; Baz baz = fooClient; }
public async Task <ActionResult> Register(RegisterViewModel model) { if (ModelState.IsValid) { var user = new ApplicationUser { UserName = model.UserName, Email = model.Email }; if (model.BarClient == true) { user.UserRole = "BarClient"; } else { user.UserRole = "PatronClient"; } var result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { if (user.UserRole == "PatronClient") { var p = new PatronClient(); p.UserId = user.Id; p.UserName = user.UserName; db.PatronClients.Add(p); try { db.SaveChanges(); } catch (Exception ex) { var ex1 = ex; } } if (user.UserRole == "BarClient") { var bar = new BarClient(); bar.UserId = user.Id; bar.UserName = user.UserName; db.BarClients.Add(bar); try { db.SaveChanges(); } catch (Exception ex) { var ex1 = ex; } } await SignInManager.SignInAsync(user, isPersistent : false, rememberBrowser : false); // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771 // Send an email with this link // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id); // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme); // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>"); return(RedirectToAction("Index", "Home")); } AddErrors(result); } // If we got this far, something failed, redisplay form return(View(model)); }