示例#1
0
        public static void Delete(int id)
        {
            PenjaminanDatasetTableAdapters.DivisiTableAdapter ta = new PenjaminanDatasetTableAdapters.DivisiTableAdapter();
            PenjaminanDataset.DivisiDataTable dt = ta.GetDataByID(id);

            try
            {
                if (dt != null)
                {
                    dt[0].Delete();

                    ta.Update(dt);
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message, ex);
            }
        }
示例#2
0
        public static void UpdateData(int Id, string NamaDivisi)
        {
            PenjaminanDatasetTableAdapters.DivisiTableAdapter ta = new PenjaminanDatasetTableAdapters.DivisiTableAdapter();
            PenjaminanDataset.DivisiDataTable dt = ta.GetDataByID(Id);

            try
            {
                if (dt != null)
                {
                    //dt[0].ID = Id;
                    dt[0].NamaDivisi = NamaDivisi;


                    ta.Update(dt);
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message, ex);
            }
        }