protected void ButtonFind_OnClick(object sender, EventArgs e)
        {
            var sportsmen = DataService.GetSportsmen(TextBoxLastName.Text, TextBoxFirstName.Text, TextBoxPatronymic.Text, TextBoxCodeGroup.Text);

            SportsmenRepeater.DataSource = sportsmen;
            SportsmenRepeater.DataBind();
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Params["sportsman"] != null)
            {
                string    sportsman = Request.Params["sportsman"];
                var       arr       = sportsman.Split(';');
                Sportsman deleted   = new Sportsman()
                {
                    LastName   = arr[0],
                    FirstName  = arr[1],
                    Patronymic = arr[2],
                    CodeGroup  = arr[3]
                };
                DataService.DeleteSportsman(deleted);
                var newUri = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.IndexOf(Request.Url.Query, StringComparison.Ordinal));
                Response.Redirect(newUri);
            }

            SportsmenRepeater.DataSource = DataService.GetAllSportsmen();
            SportsmenRepeater.DataBind();
        }