Exemple #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            productservice.Service1Client c1 = new productservice.Service1Client();
            string selectvalue = selectcategory.SelectedItem.Value;

            if (selectvalue == "Laptop")
            {
                List <productservice.Electronic> laptop = c1.GetLaptop().ToList();
                Repeater1.DataSource = laptop;
                Repeater1.DataBind();
            }
            if (selectvalue == "Mobile")
            {
                // productservice.Service1Client c1 = new productservice.Service1Client();
                List <productservice.Electronic> mobile = c1.GetMobile().ToList();
                Repeater1.DataSource = mobile;
                Repeater1.DataBind();
            }
            if (selectvalue == "Book")
            {
                // productservice.Service1Client c1 = new productservice.Service1Client();
                List <productservice.Book> book = c1.GetBooks().ToList();
                Repeater1.DataSource = book;
                Repeater1.DataBind();
            }
        }
Exemple #2
0
        public void Displaydata()
        {
            productservice.Service1Client c1  = new productservice.Service1Client();
            List <productservice.Car>     car = c1.getcar().ToList();

            repmyads.DataSource = car;
            repmyads.DataBind();
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            productservice.Service1Client    c1     = new productservice.Service1Client();
            List <productservice.Car>        car    = c1.getcar().ToList();
            List <productservice.Electronic> laptop = c1.GetElectronics().ToList();

            //car.ForEach(item => laptop.Add(item));


            Repeater1.DataSource = car;
            Repeater1.DataBind();
            //   int i1 = car.Count();
        }
Exemple #4
0
 public void DeleteCar(Int32 Id)
 {
     try
     {
         productservice.Service1Client c1 = new productservice.Service1Client();
         string car = c1.deletcar(Id);
         Displaydata();
     }
     catch (Exception)
     {
         Label1.Text = "data nnot  deleted";
     }
 }