public static void SoftDeleteData(int id) { PenjaminanDatasetTableAdapters.KaryawanTableAdapter ta = new PenjaminanDatasetTableAdapters.KaryawanTableAdapter(); PenjaminanDataset.KaryawanDataTable dt = ta.GetDataByID(id); try { if (dt != null) { dt[0].isDelete = true; ta.Update(dt); } } catch (Exception ex) { throw new ApplicationException(ex.Message, ex); } }
public static void UpdateData(int id, string Name, int divisiID, string alamat) { PenjaminanDatasetTableAdapters.KaryawanTableAdapter ta = new PenjaminanDatasetTableAdapters.KaryawanTableAdapter(); PenjaminanDataset.KaryawanDataTable dt = ta.GetDataByID(id); try { if (dt != null) { dt[0].Nama = Name; dt[0].DivisiID = divisiID; dt[0].Alamat = alamat; //dt[0].NamaDivisi = NamaDivisi; ta.Update(dt); } } catch (Exception ex) { throw new ApplicationException(ex.Message, ex); } }