private void Hapus_Click(object sender, EventArgs e) { DialogResult dialog = MessageBox.Show("Yakin ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialog == DialogResult.Yes) { BranchesModel branch = (BranchesModel)BranchBS.Current; BranchXpCollection.Remove(branch); branch.Delete(); BranchUOW.CommitChanges(); } }
private void Simpan_Click(object sender, EventArgs e) { if (!validator.Validate()) { return; } BranchesModel branch = (BranchesModel)BranchBS.Current; branch.Save(); BranchXpCollection.Add(branch); BranchUOW.CommitChanges(); BranchBS.EndEdit(); ViewState(); }