private void editbranchbtn_Click(object sender, EventArgs e) { if (editlocationtxt.Text == String.Empty) { MessageBox.Show("Fill all Fields", "Required", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (editcomboadmin.SelectedIndex > 0) { B.Br_Admin_ID = itemid[editcomboadmin.SelectedIndex]; } B.Location = editlocationtxt.Text; ServiceBranch.BranchServiceClient s = new ServiceBranch.BranchServiceClient(); ServiceBranch.Branchdata data = new ServiceBranch.Branchdata(); data = s.updateBranch(B); if (data != null) { MessageBox.Show("Edit Successfully", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Information); Load_data(); AddPanel.Hide(); EditPanel.Hide(); List.Show(); } else { MessageBox.Show("Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void editbranchbtn_Click(object sender, EventArgs e) { B.Br_Admin_ID = UserInfo.id; B.Location = editlocationtxt.Text; ServiceBranch.BranchServiceClient s = new ServiceBranch.BranchServiceClient(); ServiceBranch.Branchdata data = new ServiceBranch.Branchdata(); data = s.updateBranch(B); if (data != null) { MessageBox.Show("Edit Successfully", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Information); Load_data(); List.Show(); EditPanel.Hide(); } else { MessageBox.Show("Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }