Пример #1
0
        public bool DeleteOpt(console.Models.tbl_OptIn entity)
        {
            bool result = false;

            using (var context = new console.Models.dream_techContext())
            {
                context.tbl_OptIn.Remove(entity);
                result = context.SaveChanges() > 1;
            }
            return(result);
        }
Пример #2
0
        public bool UpdateOpt(console.Models.tbl_OptIn entity)
        {
            bool result = false;

            using (var context = new console.Models.dream_techContext())
            {
                tbl_OptIn opt = (from o in context.tbl_OptIn where o.opt_id == entity.opt_id select o).First();

                opt.user_id     = entity.user_id;
                opt.opt_type_id = entity.opt_type_id;

                result = context.SaveChanges() > 1;
            }
            return(result);
        }