예제 #1
0
        public int Save(RoleDetail obj)
        {
            var result = 0;

            try
            {
                _context.Conn.Insert(obj);
                result = 1;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(result);
        }
예제 #2
0
        public int Delete(RoleDetail obj)
        {
            var result = 0;

            try
            {
                string sql = "DELETE FROM role_detail WHERE (role_kode = @kode AND menu_name = @parent) "
                             + "OR (role_kode = @kode AND menu_parent = @parent)";

                result = _context.Conn.Execute(sql, new
                {
                    kode   = obj.role_kode,
                    parent = obj.menu_parent
                });
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(result);
        }
예제 #3
0
 public int Update(RoleDetail obj)
 {
     throw new NotImplementedException();
 }