Exemplo n.º 1
0
        public bool Delete(TabTemplate t)
        {
            try
            {
                Func <bool> func = new Func <bool>(() =>
                {
                    using (var db = new Dashboard1Entities())
                    {
                        t.stat_void       = 1;
                        db.Entry(t).State = System.Data.Entity.EntityState.Modified;
                        db.SaveChanges();
                        return(true);
                    }
                });

                return(_adapter.Catch <bool>(func));
            }
            catch (Exception ex)
            {
                throw new Exception($"TabTemplate Del fail:{ex.Message}");
            }
        }
Exemplo n.º 2
0
        public bool Insert(UsersGroupsRel t)
        {
            try
            {
                Func <bool> func = new Func <bool>(() =>
                {
                    using (var db = new Dashboard1Entities())
                    {
                        t.stat_void       = 0;
                        db.Entry(t).State = System.Data.Entity.EntityState.Added;
                        db.SaveChanges();
                        return(true);
                    }
                });

                return(_adapter.Catch <bool>(func));
            }
            catch (Exception ex)
            {
                throw new Exception($"UsersGroupsRel Insert fail:{ex.Message}");
            }
        }
Exemplo n.º 3
0
        public bool Insert(Item t)
        {
            try
            {
                Func <bool> func = new Func <bool>(() =>
                {
                    using (var db = new Dashboard1Entities())
                    {
                        t.stat_void       = 0;
                        t.dt_create       = DateTime.Now;
                        db.Entry(t).State = System.Data.Entity.EntityState.Added;
                        db.SaveChanges();
                        return(true);
                    }
                });

                return(_adapter.Catch <bool>(func));
            }
            catch (Exception ex)
            {
                throw new Exception($"ItemRepositry GetAll fail:{ex.Message}");
            }
        }
Exemplo n.º 4
0
        public bool Update(Group t)
        {
            try
            {
                Func <bool> func = new Func <bool>(() =>
                {
                    using (var db = new Dashboard1Entities())
                    {
                        t.stat_void = 0;

                        db.Entry(t).State = System.Data.Entity.EntityState.Modified;
                        db.SaveChanges();
                        return(true);
                    }
                });

                return(_adapter.Catch <bool>(func));
            }
            catch (Exception ex)
            {
                throw new Exception($"GroupRepositry Update fail:{ex.Message}");
            }
        }