public void Test() { var rep = new UserDbRepository(); //var res = rep.GetBuPasswordAndLogin("DotNetZip901", "fafnir901"); //res.Avatar = WebRock.Utils.FileUtils.IOUtils.GetDataFromUrl(@"D:\WP_20150325_001.jpg"); //rep.Update(res); }
public UnitOfWork() { Stations = new StationDbRepository(_context); Routes = new RouteDbRepository(_context); Favourites = new FavouritesDbRepository(_context); Users = new UserDbRepository(_context); }
public static void Main(string[] args) { log4net.Config.XmlConfigurator.Configure(); BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider(); serverProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider(); IDictionary props = new Hashtable(); props["port"] = 55555; TcpChannel channel = new TcpChannel(props, clientProv, serverProv); ChannelServices.RegisterChannel(channel, false); IUserRepository userRepo = new UserDbRepository(); ITicketRepository ticketRepo = new TicketDbRepository(); IShowRepository showRepo = new ShowDbRepository(); var server = new Service(userRepo, ticketRepo, showRepo); RemotingServices.Marshal(server, "MusicFestival"); //RemotingConfiguration.RegisterWellKnownServiceType(typeof(Service), "MusicFestival", WellKnownObjectMode.Singleton); // the server will keep running until keypress. Console.WriteLine("Server started ..."); Console.WriteLine("Press <enter> to exit..."); Console.ReadLine(); }
public UnitOfWork(MyDbContext context) { _context = context; Users = new UserRepository(_context); Items = new ItemRepository(_context); UserDb = new UserDbRepository(_context); Inventories = new InventoryRepository(_context); InventoryItems = new InventoryItemRepository(_context); }
public TrashProvidersViewModel(IDatabase database) { userDbRepository = new UserDbRepository(database.Connection); RestoreUserInTrashCommand = new RelayCommand(RestoreUserInTrash); DeleteUserInTrashCommand = new RelayCommand(DeleteUserInTrash); SearchFildsColection = userDbRepository.UserFieldsColectionMethod(); searchFild = SearchFildsColection[0]; }
public SelectRecipientViewModel(IDatabase database) { userDbRepository = new UserDbRepository(database.Connection); navigation = new WindowsNavigation(); SelectUserCommand = new RelayCommand(SelectUser); SearchFildsColection = userDbRepository.UserFieldsColectionMethod(); searchFild = SearchFildsColection[0]; }
public GameViewModel(INavigation navigation, ITimer timer, IResources resources, IDatabase database) { _navigation = navigation; userDbRepository = new UserDbRepository(database.Connection); _timer = timer; _resources = resources; _timer.OnTick = TimerTick; _model.SnakeChanged += _model_SnakeChanged; _model.FruitChanged += _model_FruitChanged; _pauseButtonSource = _resources.ImageNotPaused; }
public ListProvidersViewModel(IDatabase database) { navigation = new WindowsNavigation(); userDbRepository = new UserDbRepository(database.Connection); DeleteUserCommand = new RelayCommand(DeleteUser); EditUserCommand = new RelayCommand(EditUser); SearchFildsColection = userDbRepository.UserFieldsColectionMethod(); searchFild = SearchFildsColection[0]; }
public DraftsProvidersViewModel(IDatabase database) { navigation = new WindowsNavigation(); userDbRepository = new UserDbRepository(database.Connection); DeleteUserInDraftsCommand = new RelayCommand(DeleteUserInDrafts); AddProvidersWithDraftsCommand = new RelayCommand(AddProvidersWithDrafts); SearchFildsColection = userDbRepository.UserFieldsColectionMethod(); searchFild = SearchFildsColection[0]; }
public AddProvidersViewModel(IDatabase database) { userDbRepository = new UserDbRepository(database.Connection); AddUserToDatabaseCommand = new RelayCommand(AddUserToDatabase); ClearAllFieldsCommand = new RelayCommand(ClearAllFields); AddUserToDraftsCommand = new RelayCommand(AddUserToDrafts); TypeColection = userDbRepository.TypeColectionMethod(); StateColection = userDbRepository.StateColectionMethod(); CountryColection = userDbRepository.CountryColectionMethod(); }
public EditWithListProvidersViewModel(IDatabase database) { userDbRepository = new UserDbRepository(database.Connection); documentDbRepository = new DocumentDbRepository(database.Connection); SaveChangesCommand = new RelayCommand(SaveChanges); TypeColection = userDbRepository.TypeColectionMethod(); StateColection = userDbRepository.StateColectionMethod(); CountryColection = userDbRepository.CountryColectionMethod(); Messenger.Default.Register <User>(this, "AddWithList", this.FillFields); }
public AddWithDraftsProvidersViewModel(IDatabase database) { userDbRepository = new UserDbRepository(database.Connection); AddUserToDatabaseCommand = new RelayCommand(AddUserToDatabase); ClearAllFieldsCommand = new RelayCommand(ClearAllFields); TypeColection = userDbRepository.TypeColectionMethod(); StateColection = userDbRepository.StateColectionMethod(); CountryColection = userDbRepository.CountryColectionMethod(); Messenger.Default.Register <User>(this, "AddWithDrafts", this.FillFields); }
public static void Main(string[] args) { log4net.Config.XmlConfigurator.Configure(); IUserRepository userRepo = new UserDbRepository(); ITicketRepository ticketRepo = new TicketDbRepository(); IShowRepository showRepo = new ShowDbRepository(); IService serviceImpl = new Service(userRepo, ticketRepo, showRepo); Console.WriteLine("userRepo size : " + userRepo.FindAll().Count); SerialServer server = new SerialServer("127.0.0.1", 55555, serviceImpl); server.Start(); Console.WriteLine("Server started ..."); }
static void TestUserRepo() { IUserRepository repo = new UserDbRepository(); Assert.IsTrue(repo.FindOne("test1", "test1")); Assert.IsFalse(repo.FindOne("test0", "test0")); int i = 1; foreach (var user in repo.FindAll()) { Console.WriteLine(user.ToString()); Assert.IsTrue(user.Name.Contains("test" + i)); Assert.IsTrue(user.Password.Contains("test" + i)); Assert.AreEqual(user.Name, user.Password); i++; } }
public object Convert(object value, Type targetType, object parameter, string language) { if (value.ToString() == string.Empty) { return(value); } else { User user = new User(); UserDbRepository userDbRepository = new UserDbRepository(Singletons.Singleton_ConnectionValue.Instance.SQLiteConnection); user = userDbRepository.GetUserInDatabase((string)value); if (user == null) { return("B.Danych ; Numer NIP: " + value.ToString() + " "); } else { return(user.NameCompany); } } }
public HighscoreViewModel(INavigation navigation, IDatabase database) { userDbRepository = new UserDbRepository(database.Connection); this.navigation = navigation; LoadScore(CurrentScores); }