Esempio n. 1
0
        public void TestUpdateClient()
        {
            var clientGuid = Guid.NewGuid();
            var client     = new Client
            {
                Guid     = clientGuid,
                Login    = "******",
                Password = "******"
            };

            DbClientWorker.AddClient(client);

            var getClient = DbClientWorker.GetClient(clientGuid);

            Assert.IsNotNull(getClient);

            getClient.Login    = "******";
            getClient.Password = "******";
            DbClientWorker.UpdateClient(getClient);

            var updatedClient = DbClientWorker.GetClient(clientGuid);

            Assert.IsNotNull(getClient);
            Assert.AreEqual(getClient.Login, "nigoLtseTtinU");
            Assert.AreEqual(getClient.Password, "drowssaPtseTtinU");

            DbClientWorker.DeleteClient(clientGuid);
        }
Esempio n. 2
0
        public void TestGetClient()
        {
            var clientGuid = Guid.NewGuid();
            var client     = new Client
            {
                Guid     = clientGuid,
                Login    = "******",
                Password = "******"
            };

            DbClientWorker.AddClient(client);
            var getClient = DbClientWorker.GetClient(clientGuid);

            Assert.IsNotNull(getClient);
            DbClientWorker.DeleteClient(clientGuid);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var client = DbClientWorker.GetClient(UserData.User.UserGuid.Value);
            var model  = new PersonnelCabinetWindowModel
            {
                Login          = client.Login,
                Password       = client.Password,
                FirstName      = client.FirstName,
                SecondName     = client.LastName,
                Patronymic     = client.Patronymic,
                Burthday       = client.Birthday.ToString(),
                BankCard       = client.BankCard,
                Email          = client.Email,
                PassportNumber = client.PassportNumber,
                PassportSeria  = client.PassportSeries,
                Phone          = client.Phone,
                Sex            = client.Sex,
                ImagePath      = System.IO.Path.Combine(Settings.AttachedFiles, client.ImagePath)
            };

            DataContext = model;

            SetPersonnelInfo();
        }