public ActionResult ClientList() { IClientRepo repo = ClientRepoFactory.Create(); var model = repo.GetAllClients(); return(View(model)); }
public RoomController(IClientRepo clientRepo, IRoomRepo roomRepo, IMapper mapper, IEmailer emailer) { _clientRepo = clientRepo; _roomRepo = roomRepo; _mapper = mapper; _emailer = emailer; }
public ActionResult AddClient(ClientVM c) { ITrainerRepo trepo = TrainerRepoFactory.Create(); IClientRepo repo = ClientRepoFactory.Create(); if (ModelState.IsValid) { c.Trainers = new List <Trainer>(); var client = new Client { Trainers = new List <Trainer>(), ClientName = c.ClientName, StartingWeight = c.StartingWeight, CurrentWeight = c.CurrentWeight, FitnessGoals = c.FitnessGoals, }; foreach (var trainerID in c.SelectedTrainerID) { client.Trainers.Add(trepo.GetTrainerById(trainerID)); } repo.AddClient(client); } else { return(View(c)); } return(RedirectToAction("ClientList")); }
public ActionResult EditWorkout(WorkoutVM w) { IWorkoutRepo wrepo = WorkoutRepoFactory.Create(); IClientRepo repo = ClientRepoFactory.Create(); ITrainerRepo trepo = TrainerRepoFactory.Create(); if (ModelState.IsValid) { var workout = new Workout { WorkoutID = w.WorkoutID, WorkoutName = w.WorkoutName, WorkoutDescription = w.WorkoutDescription, }; foreach (var trainerID in w.SelectedTrainerID) { workout.TrainerCreator.Add(trepo.GetTrainerById(trainerID)); } foreach (var clientID in w.SelectedClientID) { workout.ClientsOnWorkout.Add(repo.GetClientById(clientID)); } wrepo.EditWorkout(workout); } return(RedirectToAction("WorkoutList")); }
public ActionResult AddTrainer(TrainerVM t) { ITrainerRepo trepo = TrainerRepoFactory.Create(); IClientRepo repo = ClientRepoFactory.Create(); if (ModelState.IsValid) { var trainer = new Trainer { StartDate = DateTime.Today, TrainerID = t.TrainerID, TrainerName = t.TrainerName, HourlyRate = t.HourlyRate }; foreach (var clientID in t.SelectedClientID) { trainer.Clientelle.Add(repo.GetClientById(clientID)); } trepo.AddTrainer(trainer); } else { return(View(t)); } return(RedirectToAction("Index", "Home")); }
public ActionResult DeleteClient(int ClientId) { IClientRepo repo = ClientRepoFactory.Create(); repo.DeleteClient(ClientId); return(RedirectToAction("ClientList")); }
public FlightServerImpl(AngajatRepository angajatRepository, IZborRepo zborRepository, IClientRepo clientRepository, IBiletRepo biletRepository) { this.angajatRepository = angajatRepository; this.biletRepository = biletRepository; this.clientRepository = clientRepository; this.zborRepository = zborRepository; loggedAngajati = new Dictionary <string, IFlightObserver>(); }
protected override void Initialize(System.Web.Routing.RequestContext requestContext) { base.Initialize(requestContext); if (OTSession.OperationalClient != null) { _clientRepo = RepoGetter <ClientRepo> .Get(OTSession.LoginedUserName, OTSession.RealClient.Id, OTSession.OperationalClient.Id); } }
private void AddLogEntry(string client, IClientRepo repo) { Log log = new Log { Direction = "Outbound", Client = client, Message = "I'm Alive!", Timestamp = DateTime.Now }; repo.CreateLog(log); repo.SaveChanges(); }
public ClientService( ILoggerAdapter <ClientService> logger, IClientRepo clientRepo, IMetricService metrics) { _logger = logger; _clientRepo = clientRepo; _metrics = metrics; }
public ClientController(IUserRepo uerRepo, IHostingEnvironment env, IInvoiceRepo invRepo, RoleManager <IdentityRole> roleMgr, UserManager <UserIdentity> usrMgr, SignInManager <UserIdentity> sim, IClientRepo clRepo) { userManager = usrMgr; signInManager = sim; roleManager = roleMgr; clientRepo = clRepo; environment = env; invoiceRepo = invRepo; userRepo = uerRepo; }
public ProjectController(ApplicationDbContext ctx, IProjectRepo projRepo, IClientRepo cliRepo, IBidRepo bdRepo, UserManager <UserIdentity> usrMgr, SignInManager <UserIdentity> signInMgr) { context = ctx; projectRepo = projRepo; clientRepo = cliRepo; bidrepo = bdRepo; userManager = usrMgr; signInManager = signInMgr; }
public AccountController(UserManager <UserIdentity> userMgr, SignInManager <UserIdentity> signinMgr, RoleManager <IdentityRole> roleMgr, IClientRepo crepo, IUserRepo urepo) { userManager = userMgr; signInManager = signinMgr; roleManager = roleMgr; clientRepo = crepo; userRepo = urepo; }
public HomeController(ILogger <HomeController> logger, IVpnRepo vpnRepo, IServersRepo serverRepo, IClientRepo clientRepo, IMapper mapper, UserManager <IdentityUser> userManager, IUserRepo userRepo) { _logger = logger; _vpnRepo = vpnRepo; _serverRepo = serverRepo; _clientRepo = clientRepo; _mapper = mapper; _userManager = userManager; _userRepo = userRepo; }
public UserController(IProjectRepo prRepo, IBidRepo bRepo, IInvoiceRepo invRepo, IUserRepo usrRepo, RoleManager <IdentityRole> roleMgr, UserManager <UserIdentity> usrMgr, SignInManager <UserIdentity> sim, IClientRepo clRepo) { userManager = usrMgr; signInManager = sim; roleManager = roleMgr; clientRepo = clRepo; userRepo = usrRepo; invoiceRepo = invRepo; bidRepo = bRepo; projectRepo = prRepo; }
public ActionResult EditTrainer(int id) { ITrainerRepo trepo = TrainerRepoFactory.Create(); IClientRepo repo = ClientRepoFactory.Create(); var trainer = trepo.GetTrainerById(id); var model = new TrainerVM { TrainerID = trainer.TrainerID, TrainerName = trainer.TrainerName, HourlyRate = trainer.HourlyRate, }; return(View(model)); }
public OrderController(KadettenContext context, IOrderRepo orderRepo, IClientRepo clientRepo, ITicketOrderRepo ticketOrderRepo, ITicketRepo ticketRepo, IKadettRepo kadettRepo, ILogger <OrderController> logger , IUserRepo userRepo, IEmailSenderService emailSenderService, IHostingEnvironment env) { _logger = logger; _context = context; _orderRepo = orderRepo; _ticketOrderRepo = ticketOrderRepo; _clientRepo = clientRepo; _ticketRepo = ticketRepo; _userRepo = userRepo; _kadettRepo = kadettRepo; _emailSenderService = emailSenderService; HostingEnvironment = env; }
public ActionResult EditClient(int id) { IClientRepo repo = ClientRepoFactory.Create(); var client = repo.GetClientById(id); var model = new ClientVM { ClientId = client.ClientID, ClientName = client.ClientName, StartingWeight = client.StartingWeight, CurrentWeight = client.CurrentWeight, FitnessGoals = client.FitnessGoals, ClientTrainer = client.ClientTrainer }; return(View(model)); }
private void InitFields() { MembershipUser user = _membership.GetUser(); if (user != null && _loginedUserId.ToString() != user.ProviderUserKey.ToString()) { _loginedUserName = user.UserName; _loginedUserId = new Guid(user.ProviderUserKey.ToString()); _realClient = ClientRepo.GetClientProjected(_loginedUserId); if (_realClient != null) { _repo = RepoGetter <ClientRepo> .Get(_loginedUserName, _realClient.Id, GetOperationalClientId().Value); _currentBallance = _realClient.Ballance; } } }
public ActionResult EditTrainer(TrainerVM t) { IClientRepo repo = ClientRepoFactory.Create(); ITrainerRepo trepo = TrainerRepoFactory.Create(); if (ModelState.IsValid) { var trainer = new Trainer { Clientelle = new List <Client>(), TrainerID = t.TrainerID, TrainerName = t.TrainerName, HourlyRate = t.HourlyRate, StartDate = t.StartDate, }; foreach (var clientID in t.SelectedClientID) { trainer.Clientelle.Add(repo.GetClientById(clientID)); } trepo.EditTrainer(trainer); } return(RedirectToAction("Index", "Home")); }
public ExternalDebtController(IClientRepo db) { this._db = db; }
public void SelectClientsWithSkipTake() { IClientRepo repo = RepoFactory.GetClientRepo(); List <ClientModel> models = repo.Select(0, 10) as List <ClientModel>; }
private void TryInitClientRepo() { ClientRepo = RepoGetter <ClientRepo> .Get(string.Empty, null, null); }
public UserInvoice(IInvoiceRepo repo, IClientRepo clRepo) { repository = repo; clientRepo = clRepo; }
public VpnController(IVpnRepo vpnRepo, IMapper mapper, IClientRepo clientRepo) { _vpnRepo = vpnRepo; _mapper = mapper; _clientRepo = clientRepo; }
protected override void Seed(FitnessApp.UI.FitnessDBContext context) { //create repos and userMGr and roleMgr to use throughout seed data ITrainerRepo orgrepo = TrainerRepoFactory.Create(); IClientRepo herorepo = ClientRepoFactory.Create(); IWorkoutRepo locorepo = WorkoutRepoFactory.Create(); var userMgr = new UserManager <IdentityUser>(new UserStore <IdentityUser>(context)); var roleMgr = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(context)); if (!roleMgr.RoleExists("User")) { var role = new IdentityRole(); role.Name = "User"; roleMgr.Create(role); } if (!userMgr.Users.Any(u => u.UserName == "user")) { var user = new IdentityUser() { UserName = "******" }; userMgr.Create(user, "testing"); } var findmanager = userMgr.FindByName("user"); // create the user with the manager class if (!userMgr.IsInRole(findmanager.Id, "user")) { userMgr.AddToRole(findmanager.Id, "user"); } if (!roleMgr.RoleExists("admin")) { roleMgr.Create(new IdentityRole() { Name = "admin" }); } if (!userMgr.Users.Any(u => u.UserName == "admin")) { var user = new IdentityUser() { UserName = "******" }; userMgr.Create(user, "testing"); } var finduser = userMgr.FindByName("admin"); // create the user with the manager class if (!userMgr.IsInRole(finduser.Id, "admin")) { userMgr.AddToRole(finduser.Id, "admin"); } if (!context.Trainers.Any(t => t.TrainerName == "Arnold")) { var firsttrainer = new Trainer { TrainerName = "Arnold", TrainerID = 1, HourlyRate = 25, StartDate = new DateTime(2017, 1, 18), }; context.Trainers.Add(firsttrainer); context.SaveChanges(); } var trainer = context.Trainers.First(t => t.TrainerName == "Arnold"); if (!context.Clients.Any(c => c.ClientName == "Jarid")) { var firstclient = new Client { ClientName = "Jarid", ClientID = 1, ClientJoinDate = new DateTime(2017, 3, 23), CurrentWeight = 158, StartingWeight = 133, FitnessGoals = "I gotta get jacked so girls will want this hot body", }; context.Clients.Add(firstclient); context.SaveChanges(); } var client = context.Clients.First(c => c.ClientName == "Jarid"); if (!context.Workouts.Any(w => w.WorkoutName == "5x5 StrongLifts")) { var firstworkout = new Workout { WorkoutID = 1, WorkoutName = "5x5 StrongLifts", WorkoutDescription = "5 sets of 5 reps. Squat, Bench, Deadlift, Overhead and Row. Add 5 pounds after each workout.", }; context.Workouts.Add(firstworkout); context.SaveChanges(); } var workout = context.Workouts.First(w => w.WorkoutName == "5x5 StrongLifts"); }
public HomeController(ILogger <HomeController> logger, IRepository repository, IClientRepo clientRepo) { _logger = logger; _model = new ViewModel { MyDetails = repository.GetAllData(), Clients = clientRepo.GetClients() }; }
public ApplicationModel(IClientRepo clientRepo) { _clientRepo = clientRepo; }
public ClientController(IClientRepo clientRepo, IMapper mapper) { _clientRepo = clientRepo; _mapper = mapper; }
public VenueController(IClientRepo <DB_Data.Models.Clients> repo) { _repository = repo; }