Пример #1
0
 protected void PersonsGrid_ItemInserted(object sender, GridInsertedEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         SetMessage("Customer cannot be inserted. Reason: " + e.Exception.Message);
     }
     else
     {
         SetMessage("New customer is inserted!");
         persons = serviceClient.GetPersons();
     }
 }
 public ActionResult Index(PersonAddressModel model)
 {
     var client = new PersonServiceClient();
     var persons = client.GetPersons(1, model.City, model.Province, model.Country, model.Name).ToList();
     model.Items = persons;
     return View(model);
 }
        public ActionResult Index(PersonAddressModel model)
        {
            var client  = new PersonServiceClient();
            var persons = client.GetPersons(2, model.City, model.Province, model.Country, model.Name).ToList();

            model.Items = persons;
            return(View(model));
        }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsCallback)
     {
         serviceClient = new PersonServiceClient();
         persons       = serviceClient.GetPersons();
         personTypes   = serviceClient.GetPersonTypes();
     }
 }
Пример #5
0
        public async Task GetPersons()
        {
            PersonRepositoryMock.Setup(x => x.GetAll())
            .Returns(new List <Person> {
                _person
            });

            var response = await PersonServiceClient.GetPersons();

            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
            Assert.AreEqual(1, response.Result.Count);
            Assert.AreEqual("Mocked LN1", response.Result[0].LastName);
        }
        public async Task GetRounds()
        {
            string gamekey = "3453532";

            PersonRepositoryMock.Setup(x => x.GetAll(1))
            .Returns(new List <Round> {
                _round
            });

            var response = await PersonServiceClient.GetPersons();

            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
            Assert.AreEqual(1, response.Result.Count);
            Assert.AreEqual("Mocked FN1", response.Result[0].Name);
        }