private void Simpan_Click(object sender, EventArgs e) { if (!validator.Validate()) { return; } BranchmanagersModel branchmanagers = (BranchmanagersModel)BMBS.Current; branchmanagers.karyawanId = ( from c in k_coll where c.id == Convert.ToInt64(karyawanid.EditValue) select c ).FirstOrDefault(); branchmanagers.branchId = ( from c in b_coll where c.id == Convert.ToInt64(branchid.EditValue) select c ).FirstOrDefault(); if (branchmanagers.createdAt == null) { branchmanagers.createdAt = DateTime.Now; } branchmanagers.updatedAt = DateTime.Now; branchmanagers.Save(); BMXpCollection.Add(branchmanagers); BMUOW.CommitChanges(); BMBS.EndEdit(); ViewState(); }
private void Hapus_Click(object sender, EventArgs e) { DialogResult dialog = MessageBox.Show("Yakin ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialog == DialogResult.Yes) { BranchmanagersModel branchmanagers = (BranchmanagersModel)BMBS.Current; BMXpCollection.Remove(branchmanagers); branchmanagers.Delete(); BMUOW.CommitChanges(); } }