Пример #1
0
        public static void SoftDeleteData(int id)
        {
            PenjaminanDatasetTableAdapters.u_roleTableAdapter ta = new PenjaminanDatasetTableAdapters.u_roleTableAdapter();
            PenjaminanDataset.u_roleDataTable dt = ta.GetDataRoleByID(id);

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

                    ta.Update(dt);
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message, ex);
            }
        }
Пример #2
0
        public static void UpdateData(int Id, string Name, string Description)
        {
            PenjaminanDatasetTableAdapters.u_roleTableAdapter ta = new PenjaminanDatasetTableAdapters.u_roleTableAdapter();
            PenjaminanDataset.u_roleDataTable dt = ta.GetDataRoleByID(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);
            }
        }