Exemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //Normally I wouldn't put code like this here
            //But I'm just doing this for simplicity
            //Ryan
            Hydrator<Customer> hydrator = new Hydrator<Customer>()
            .With(x=>x.FirstName, txtFirstName.Text)
            .With(x => x.LastName, txtLastName.Text)
            .With(x=>x.StreetAddress,txtStreetAddress.Text)
            .With(x=>x.City,txtCity.Text)
            .With(x=>x.State,txtState.Text)
            .With(x=>x.Zip,txtZip.Text);

            Customer savethis = hydrator.GetSingle();

            CustomerRepository cr = new CustomerRepository();
            cr.SaveCustomer(savethis);
            Response.Redirect("/");
        }
 protected void Search_Click(object sender, EventArgs e)
 {
     CustomerRepository custrepos = new CustomerRepository();
     GridView1.DataSource = custrepos.RealSearchByLastName(txtLastName.Text);
     GridView1.DataBind();
 }