private void gridView4_RowUpdated_1(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e) { var obj = e.Row as Customer; getBusiness = new CustomerBusinessLayer(); try { if (obj != null) { getBusiness.Update(obj); } } catch (Exception) { XtraMessageBox.Show("Güncelleme sırasında hata oluştu tekrar deneyiniz!"); } finally { FillGrid(); } }
private void Save(Customer model) { try { if (_id == 0) { getBusiness = new CustomerBusinessLayer(); getBusiness.Insert(model); } if (_id > 0) { getBusiness = new CustomerBusinessLayer(); getBusiness.Update(model); } FillGrid(); } catch (Exception ex) { throw new Exception(ex.Message.ToString()); } }