public Service(IRepositoryRezervare repoRezervare, IRepositoryUser repoUsers, IRepositoryExcursie repoExcursie) { loggedClients = new Dictionary <String, IObserver>(); this.repoRezervare = repoRezervare; this.repoUsers = repoUsers; this.repoExcursie = repoExcursie; }
public AdminCompanyGoodsController(IRepositoryUser repositoryUser, IRepositoryCompany repositoryCompany, IRepositoryGood repositoryGood, IRepositoryImage repositoryImage) { _repositoryUser = repositoryUser; _repositoryCompany = repositoryCompany; _repositoryGood = repositoryGood; _repositoryImage = repositoryImage; }
public async Task <IActionResult> Watchlist([FromServices] IRepositoryUser repoUser) { List <WatchlistItems> searchedSymbols = new List <WatchlistItems>(); var watchlist = repoUser.RetrieveUserWatchlist(); var symbols = watchlist.Split(';'); foreach (string sym in symbols) { var reqUri = "https://" + $@"www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=" + sym + "&apikey=" + _apiKey; using (var httpClient = new HttpClient()) { using (var response = await httpClient.GetAsync(reqUri)) { string apiResponse = await response.Content.ReadAsStringAsync(); dynamic data = JsonConvert.DeserializeObject(apiResponse); var count = data.bestMatches.Count; var firstMatch = data.bestMatches[0]; WatchlistItems wl = (JsonConvert.DeserializeObject <WatchlistItems>(firstMatch.ToString())); searchedSymbols.Add(wl); } } } return(View(searchedSymbols)); //return View(model); }
public ActionResult Login(UserLogin user) { User userFromDB; rep = new RepositoryUserDB(); rep.Open(); userFromDB = rep.Login(user); rep.Close(); // Username und Passwort stimmen nicht mit den BD-Daten überein if (userFromDB == null) { ModelState.AddModelError("Username", "Benutzername, Passwort oder Rolle stimmen nicht überein!"); return(View(user)); } // Daten stimmen mit DB-Werten überein else { // der komplette User wird in einer Sessionvariable abgelegt // und ist somit auf jeder Seite verfügbar Session["loggedinUser"] = userFromDB; return(RedirectToAction("index", "home")); } }
public ServiceVideo(IRepositoryUser repositoryUser, IRepositoryChannel repositoryChannel, IRepositoryPlayList repositoryPlayList, IRepositoryVideo repositoryVideo) { _repositoryUser = repositoryUser; _repositoryChannel = repositoryChannel; _repositoryPlayList = repositoryPlayList; _repositoryVideo = repositoryVideo; }
public BusinessCustomer(IUnityOfWork uow, IRepositoryCustomer repositoryCustomer, IRepositoryAddress repositoryAddress, IRepositoryUser repUser) : base(uow) { _repAddress = repositoryAddress; _repCustomer = repositoryCustomer; _repUser = repUser; }
public CartController(IRepositoryUser user, ICartProductsRepository cartProdrepo, IProductDetailsRepo product, ICartRepository cart) { _user = user; _cartProdrepo = cartProdrepo; _product = product; _cart = cart; }
public void Init(HttpApplication context) { context.AuthenticateRequest += OnApplicationAuthenticateRequest; context.EndRequest += OnApplicationEndRequest; this._repositoryUser = DependencyInjector.Container.BeginLifetimeScope().Resolve <IRepositoryUser>(); }
public ActionResult Registration(User user) { if (user == null) { return(View(user)); } CheckUserData(user); if (!ModelState.IsValid) { return(View(user)); } else { user.UserRole = UserRole.registeredUser; rep = new RepositoryUser(); rep.Open(); if (rep.Insert(user)) { rep.Close(); return(RedirectToAction("Login")); } else { rep.Close(); return(View(user)); } } }
public ActionResult DeleteRegisteredUser(int idUser) { if (Session["loggedInUser"] == null) { return(RedirectToAction("login", "admin")); } if (!Convert.ToBoolean(Session["isAdmin"])) { return(RedirectToAction("index", "home")); } rep = new RepositoryUser(); rep.Open(); if (rep.Delete(idUser)) { rep.Close(); return(RedirectToAction("RegisteredUsers", "admin")); } else { rep.Close(); return(View("Message", new Message("Löschen", "Löschen war nicht erfolgreich"))); } }
public ActionResult Login(UserLogin user) { User userFromDB; rep = new RepositoryUser(); rep.Open(); userFromDB = rep.Login(user); rep.Close(); if (userFromDB == null) { ModelState.AddModelError("Username", "Benutzername oder Passwort stimmen nicht überein!"); return(View(user)); } else { Session["loggedInUser"] = userFromDB; if (userFromDB.UserRole == UserRole.admin) { Session["isAdmin"] = true; } else { Session["isAdmin"] = false; } return(RedirectToAction("index", "home")); } }
public ActionResult RegisteredUsers() { if (Session["loggedInUser"] == null) { return(RedirectToAction("login", "admin")); } if (!Convert.ToBoolean(Session["isAdmin"])) { return(RedirectToAction("index", "home")); } List <User> users; rep = new RepositoryUser(); rep.Open(); users = rep.GetAllUsers(); rep.Close(); List <User> registeredUsersOnly = new List <User>(); foreach (var u in users) { if (u.UserRole == UserRole.registeredUser) { registeredUsersOnly.Add(u); } } return(View(registeredUsersOnly)); }
public ServiceVideo(IRepositoryUser repositoryUser, IRepositoryVideo repositoryVideo, IRepositoryCanal repositoryCanal, IRepositoryPlayList repositoryPlayList) { _repositoryUser = repositoryUser; _repositoryVideo = repositoryVideo; _repositoryCanal = repositoryCanal; _repositoryPlayList = repositoryPlayList; }
public ActionResult Registration(User user) { if (user == null) { return(RedirectToAction("Registration")); } CheckUserData(user); if (!ModelState.IsValid) { return(View(user)); } else { rep = new RepositoryUserDB(); //eine Verbindung zum DB server herstellen rep.Open(); //versuchen, die Userdaten einzutragen if (rep.Insert(user)) { return(View("Message", new Message("Registrierung", "Ihre Daten wurden erfolgreich abgespeichert"))); } else { //verbindung schließen rep.Close(); return(View("Message", new Message("Registrierung", "Ihre Daten konnten nicht gespeichert werden"))); } //nun würden wir die Daten in einer DatenBank abspeichern } }
public UserStatisticService( IRepositoryUser repositoryUser, IHistoryTripService historyTripService) { _repositoryUser = repositoryUser; _historyTripService = historyTripService; }
public async Task <IActionResult> Index([FromServices] IRepositoryUser repoUser) { //var model = await _context.Users.ToArrayAsync(); var model = repoUser.UsersWithAccountRole(); return(View(model)); }
public Service(IRepositoryConcert repositoryConcert, IRepositoryTicket repositoryTicket, IRepositoryUser repositoryUser) { _repositoryConcert = repositoryConcert; _repositoryTicket = repositoryTicket; _repositoryUser = repositoryUser; connectedClients = new Dictionary <string, IObserver>(); }
public UnitOfWork(string connectionString) { RepositorySubcategorias = new RepositorySubcategorias(connectionString); RepositoryUser = new RepositoryUser(connectionString); RepositoryCategorias = new RepositoryCategorias(connectionString, RepositorySubcategorias); RepositoryComentarios = new RepositoryComentarios(connectionString, RepositoryUser); RepositoryCriticas = new RepositoryCriticas(connectionString, RepositoryComentarios); }
public AuthService(IRepositoryUser <TB_EB_USER, string> repositoryTB_EB_USER, DBContextUser contextUser, IRepositoryVideo <TB_EL_System_Role, string> repositoryTB_EL_System_Role) { _repositoryTB_EB_USER = repositoryTB_EB_USER; _contextUser = contextUser; _repositoryTB_EL_System_Role = repositoryTB_EL_System_Role; }
public AdminController(IRepositoryUser repositoryUser, ICheckUserExist exist, ILogger logger, IReadFromBrowser read) { _repositoryUser = repositoryUser; _check = exist; _logger = logger; _read = read; }
public AccountController(IRepositoryUser userRepo, IRepositoryEmployee emplRepo, IRepositoryQueue queueRepo, IQueueHub hub) { _userRepository = userRepo; _employeeRepository = emplRepo; _queueRepository = queueRepo; _hub = hub; }
public void Setup() { this.user = new User { Email = "*****@*****.**", Password = "******", Username = "******" }; this.userRepository = A.Fake <IRepositoryUser>(); this.userService = A.Fake <UserServices>(); this.userService = new UserServices(this.userRepository); }
public void SetUp() { this.InitializeProduct(); this.productRepository = A.Fake <IRepositoryProduct>(); this.userRepository = A.Fake <IRepositoryUser>(); this.productService = new ProductServices(this.productRepository, this.userRepository); }
public void OneTimeSetup() { _repositoryHelper = new RepositoryHelper(); _repositoryHelper.FillTypes.AddAll(new[] { EntityType.User, EntityType.Address, EntityType.City, EntityType.Role }); _repositoryUser = _repositoryHelper.RepositoryFactory.CreateRepositoryUser(); }
public ActionResult UserData(User user) { if (user == null) { return(View(user)); } if (user.Password == null || user.Password == "") { CheckUserDataWithoutPassword(user); } else { CheckUserData(user); } if (!ModelState.IsValid) { return(View(user)); } else { user.UserRole = ((User)Session["loggedInUser"]).UserRole; rep = new RepositoryUser(); rep.Open(); if (user.Password == null || user.Password == "") { if (rep.UpdateUserDataWithoutPassword(((User)Session["loggedInUser"]).ID, user)) { rep.Close(); return(View(user)); } else { rep.Close(); return(View(user)); } } else { if (rep.UpdateUserData(user.ID, user)) { rep.Close(); return(View(user)); } else { rep.Close(); return(View(user)); } } } }
public void Insert_ShouldInvokeProductRepository_WithGivenProduct() { this.user.Product = null; this.userRepository = A.Fake <UserRepository>(); A.CallTo(() => this.userRepository.GetUserWithProducts(this.user.Id)).Returns(this.user); this.productService.Insert(this.product); A.CallTo(() => this.productRepository.Insert(this.product)).MustHaveHappened(); }
public ProductController(IRepositoryProducts repositoryProducts, IRepositoryUser user, IReadFromBrowser read, ICheckUserExist checkUser, ILogger logger) { _repositoryProducts = repositoryProducts; _repositoryUser = user; _read = read; _check = checkUser; _logger = logger; }
public AccountService(UserManager <AppUser> userManager, IRepositoryUser repositoryUser, SignInManager <AppUser> signInManager, RoleManager <IdentityRole> roleManager, IMapper mapper) { this.mapper = mapper; this.repositoryUser = repositoryUser; this.userManager = userManager; this.roleManager = roleManager; this.signInManager = signInManager; }
public SystemManagementService(IRepositoryVideo <TB_EL_System_Role, long> repositoryTB_EL_System_Role, IRepositoryUser <TB_EB_DOMAIN, long> repositoryTB_EB_DOMAIN, IRepositoryUser <TB_EB_USER, string> repositoryTB_EB_USER, DBContextUser contextUser) { _repositoryTB_EL_System_Role = repositoryTB_EL_System_Role; _repositoryTB_EB_DOMAIN = repositoryTB_EB_DOMAIN; _repositoryTB_EB_USER = repositoryTB_EB_USER; _contextUser = contextUser; }
public LoginController(IEmptyCart emptyCart, IRepositoryUser irepositoryUser, IReadFromBrowser read, IWriteToBrowser write, IEmailManger email, ILogger logger) { _irepositoryUser = irepositoryUser; _read = read; _write = write; _emptyCart = emptyCart; _sendEmail = email; _logger = logger; }
public UserController(IRepositoryUser repositoryUser) { this.repositoryUser = repositoryUser; }