Example #1
0
        public void AddPeopleTest()
        {
            PeopleDTO pdto = new PeopleDTO();

            pdto.FirstName    = "qqqq";
            pdto.LastName     = "eeee";
            pdto.SecondName   = "wwww";
            pdto.Email        = "*****@*****.**";
            pdto.DateBirthday = DateTime.Now;

            var result = peopleserv.AddPeople(pdto);

            peopleserv.DelPeople(result.Id);
            Assert.AreEqual(result.Successed, true);
        }
Example #2
0
        private void PeopleTable_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var serv = new PeopleService();

            switch (e.CommandName)
            {
            case "update":
                var updatedPeople = serv.GetPeople(Convert.ToInt32(e.CommandArgument));
                NameBox.Text   = Convert.ToString(updatedPeople.Name);
                HeightBox.Text = Convert.ToString(updatedPeople.Height);
                WeightBox.Text = Convert.ToString(updatedPeople.Weight);
                IdBox.Text     = Convert.ToString(updatedPeople.Id);
                break;

            case "delete":
                serv.DelPeople(Convert.ToInt32(e.CommandArgument));
                break;

            default:
                break;
            }

            //Refresh data
            PeopleTable.DataSource = serv.GetPeoples();
            PeopleTable.DataBind();
        }