private void buttonUpdate_Click(object sender, EventArgs e) { if (textBoxCode.Text == null) { MessageBox.Show("Code is null!!!"); } else { host.gear.cao2246soap.Smartphone smartPhone = new host.gear.cao2246soap.Smartphone() { Code = Convert.ToInt16(textBoxCode.Text), Brand = textBoxBrand.Text, Name = textBoxName.Text, Color = textBoxColor.Text, Price = Convert.ToInt32(textBoxPrice.Text) }; bool rs = SOAPservice.updateSmartPhone(smartPhone); if (rs) { MessageBox.Show("Edit Sucess ^.^"); List <host.gear.cao2246soap.Smartphone> smartPhones = SOAPservice.getAllList().ToList(); dataGridView1.DataSource = smartPhones; } else { MessageBox.Show("Something Wrong!!!"); } } }
private void buttonAdd_Click(object sender, EventArgs e) { host.gear.cao2246soap.Smartphone smartphone = new host.gear.cao2246soap.Smartphone() { Brand = textBoxBrand.Text, Name = textBoxName.Text, Color = textBoxColor.Text, Price = Convert.ToInt32(textBoxPrice.Text) }; bool rs = SOAPservice.addSmartPhone(smartphone); if (rs) { List <host.gear.cao2246soap.Smartphone> smartPhones = SOAPservice.getAllList().ToList(); dataGridView1.DataSource = smartPhones; } else { MessageBox.Show("Something Wrong!!!"); } }
/// <remarks/> public void updateSmartPhoneAsync(Smartphone smartPhone) { this.updateSmartPhoneAsync(smartPhone, null); }
/// <remarks/> public void addSmartPhoneAsync(Smartphone smartPhone) { this.addSmartPhoneAsync(smartPhone, null); }