Esempio n. 1
0
        public static void InsertData(int fk_role, int fk_page)
        {
            PenjaminanDatasetTableAdapters.AccessTableAdapter ta = new PenjaminanDatasetTableAdapters.AccessTableAdapter();

            try
            {
                ta.Insert(fk_role, fk_page, "1", DateTime.Now, null, null, "0");
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message, ex);
            }
        }
Esempio n. 2
0
        public static void UpdateDeleted(int id)
        {
            PenjaminanDatasetTableAdapters.AccessTableAdapter ta = new PenjaminanDatasetTableAdapters.AccessTableAdapter();
            PenjaminanDataset.AccessDataTable dt = ta.GetDataRestore(id);

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

                    ta.Update(dt);
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message, ex);
            }
        }
Esempio n. 3
0
        public static int validasi(int fk_role, int fk_page)
        {
            PenjaminanDatasetTableAdapters.AccessTableAdapter ta = new PenjaminanDatasetTableAdapters.AccessTableAdapter();
            PenjaminanDataset.AccessDataTable dt = ta.GetDataforVal(fk_role, fk_page);
            int value = 0;

            try
            {
                if (dt.Count != 0)
                {
                    value = 1;
                }
                else
                {
                    PenjaminanDataset.AccessDataTable dtx = new PenjaminanDataset.AccessDataTable();
                    PenjaminanDataset.AccessRow       dr  = null;
                    try
                    {
                        ta.Fillval2(dtx, fk_role, fk_page);
                        if (dtx.Count > 0)
                        {
                            dr = dtx[0];
                            UpdateDeleted(dr.id);

                            value = 2;
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new ApplicationException(ex.Message, ex);
                    }
                }
                return(value);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message, ex);
            }
        }
Esempio n. 4
0
        public static void UpdateData(int id, int fk_role, int fk_page)
        {
            PenjaminanDatasetTableAdapters.AccessTableAdapter ta = new PenjaminanDatasetTableAdapters.AccessTableAdapter();
            PenjaminanDataset.AccessDataTable dt = ta.GetDataByID(id);

            try
            {
                if (dt != null)
                {
                    dt[0].fk_page    = fk_page;
                    dt[0].fk_role    = fk_role;
                    dt[0].updateby   = "1";
                    dt[0].updatedate = DateTime.Now;


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