示例#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}");
            }
        }
示例#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}");
            }
        }
示例#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}");
            }
        }
示例#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}");
            }
        }