public static void SoftDeleteData(int id) { PenjaminanDatasetTableAdapters.m_kategoriTableAdapter ta = new PenjaminanDatasetTableAdapters.m_kategoriTableAdapter(); PenjaminanDataset.m_kategoriDataTable dt = ta.GetDataKategoriByID(id); try { if (dt != null) { dt[0].deleted = 1; ta.Update(dt); } } catch (Exception ex) { throw new ApplicationException(ex.Message, ex); } }
public static void UpdateData(int Id, string Name, string Description) { PenjaminanDatasetTableAdapters.m_kategoriTableAdapter ta = new PenjaminanDatasetTableAdapters.m_kategoriTableAdapter(); PenjaminanDataset.m_kategoriDataTable dt = ta.GetDataKategoriByID(Id); try { if (dt != null) { dt[0].name = Name; dt[0].description = Description; dt[0].lastupdatedby = 1; dt[0].lastupdateddate = DateTime.Now; ta.Update(dt); } } catch (Exception ex) { throw new ApplicationException(ex.Message, ex); } }