예제 #1
0
        public bool Insert(TabTemplate 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($"TabTemplate Insert fail:{ex.Message}");
            }
        }
예제 #2
0
        public bool Delete(Users 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($"Users Del 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(ItemGroupRel 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($"ItemGroupRelRepositry GetAll fail:{ex.Message}");
            }
        }