private void Simpan_Click(object sender, EventArgs e) { if (!validator.Validate()) { return; } SalesModel sales = (SalesModel)SalesBS.Current; sales.salesheadId = sh_coll.First(sh => sh.id == Convert.ToInt64(salesheadid.EditValue)); sales.createdAt = DateTime.Now; sales.updatedAt = DateTime.Now; sales.Save(); SalesXpCollection.Add(sales); SalesUOW.CommitChanges(); SalesBS.EndEdit(); SetDisabled(); Tambah.Enabled = true; Simpan.Enabled = false; Batal.Enabled = false; Edit.Enabled = true; Hapus.Enabled = true; gridControl1.Enabled = true; }
private void Tambah_Click(object sender, EventArgs e) { SalesBS.AddNew(); SetEnabled(); Tambah.Enabled = false; Simpan.Enabled = true; Batal.Enabled = true; Edit.Enabled = false; Hapus.Enabled = false; gridControl1.Enabled = false; }
private void Batal_Click(object sender, EventArgs e) { SalesBS.CancelEdit(); SetDisabled(); Tambah.Enabled = true; Simpan.Enabled = false; Batal.Enabled = false; Edit.Enabled = true; Hapus.Enabled = true; gridControl1.Enabled = true; }