private void btnAddStores_Click(object sender, EventArgs e) { localhost.Store st = new localhost.Store(); st.Name = txtName.Text; st.Address = txtAdress.Text; localhost.Service1 sc = new localhost.Service1(); sc.addstore(st); MessageBox.Show("Store is added"); txtName.Text = ""; txtAdress.Text = ""; }
private void Gvshowallstore_CellContentClick(object sender, DataGridViewCellEventArgs e) { localhost.Service1 sc = new localhost.Service1(); bool speci = false; if (e.ColumnIndex == 0) { localhost.Store storeO = sc.getstore(e.RowIndex, speci); localhost.Store gro = sc.getstore(e.RowIndex, speci); sc.deleteStore(gro); BindingSource s = new BindingSource(); s.DataSource = sc.shoowstores(); Gvshowallstore.DataSource = s; } }