Ejemplo n.º 1
0
        public void TestModifyUser()
        {
            User u1 = new User
            {
                Address = "test",
                Age     = "1",
                Salt    = crypto.GenerateSaltString(),
                Email   = "test",
                Name    = "test",
                PWord   = "1",
                Phone   = "1234",
                Zipcode = "9200"
            };

            userDB.AddUser(u1);

            User actual = userDB.GetAllUser().Last();

            client.ModifyUser(actual.Id, "*****@*****.**", "test", "1234", "test", "9200", "1");

            User expected = userDB.GetAllUser().Last();

            userDB.RemoveUser(expected.Id);

            Assert.AreNotEqual(actual.Email, expected.Email);
        }
Ejemplo n.º 2
0
        public ActionResult EditUser(string inputEmail, string inputName, string inputPhone, string inputAddress, string inputZipcode, string inputAge)
        {
            //if(!ModelState.IsValid)
            //return View();
            var ID = Session["ID"];

            client.ModifyUser(Convert.ToInt32(ID), inputEmail, inputName, inputPhone, inputAddress, inputZipcode, inputAge);
            return(RedirectToAction("Index", "Ads"));
        }
Ejemplo n.º 3
0
 private void btnUpdate_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (BikenBike.CurrentUser != null)
         {
             BikeService.Open();
             BikeService.ModifyUser(Convert.ToInt16(BikenBike.CurrentUser.Id), txtEmail.Text, txtName.Text, txtPhone.Text, txtAddress.Text, txtZipcode.Text, txtAge.Text);
             BikeService.Close();
             window.Content = new EditUserPage(window);
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }