|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Teamcenter二次开发ITK源码分享:设置用户的激活状态# c7 D7 I+ t& |; T5 y) H
8 J% e6 g6 |8 p7 b
/ A$ S$ Q* B9 @! u. V: F
- static void do_it(void)9 d2 p* g1 w' J- X# P3 b
- {
/ S2 s6 M- c" I) J - int
8 ?+ v' v1 B( @+ t3 k! ` - status = 0,
' K- G( H; k# T# n - new_status = 0; _6 F3 w# a8 W0 [' r0 g
- tag_t 4 g& p1 B4 k4 q7 E g5 ]8 y
- user = NULLTAG;2 j$ C' _; |; Y |; J' \3 _
- char
$ W$ a9 s- B* z% ^ - user_id[SA_user_size_c+1] = "plmhome",
0 ]9 k: v) A, F+ m6 B( `6 e% q - status_string[2][10] = {"active", "inactive"},7 F8 G1 `0 n$ E! k2 r7 _
- person_name[SA_person_name_size_c+1] = "";
5 p2 I/ y' d% A# Q - . J1 M; c1 b: Q& n- I7 z
- ITK_CALL(SA_find_user(user_id, &user));# ~; R+ Z6 F9 B
- ITK_CALL(AOM_load(user));+ N& M7 S; y# }7 ^4 ^5 s/ R
- ITK_CALL(SA_ask_user_person_name(user, person_name)); % W: D& {% U3 v; S( d
- ITK_CALL(SA_get_user_status(user, &status));
9 k4 C8 V' @/ g+ f. _1 \% E2 E - ECHO("Person Name: %s - %s\n", person_name, status_string[status]);
/ z; @' E3 T& h# W
- \ f ~1 J" v |" {- y/ g- /* reverse it */; |4 E# \& z8 y; @" U! V) [
- if (status == ACTIVE) new_status = INACTIVE;
# {/ |, @0 @* B) k, w: n) U- s' c4 J - if (status == INACTIVE) new_status = ACTIVE;
1 K/ p) B3 A. ]( n0 ^# T* I+ K( c - 6 D) o0 b% a2 n& v) [7 e; O7 c
- ITK_CALL(AOM_lock(user));
/ J% o! s9 j1 T$ g0 m7 J8 c2 y, G - ITK_CALL(SA_set_user_status(user, new_status));% C! j& e; v$ S+ n' t* U8 _8 |
- ITK_CALL(AOM_save(user));
7 @7 I/ _/ [2 v' {- c$ ` - ITK_CALL(AOM_unlock(user));% t7 T0 Y2 V, N' ?7 c, m# w: Q1 C& Z
- ITK_CALL(AOM_unload(user));5 R2 s4 M0 v: z
- }
复制代码 1 Y# T8 H, b4 }- F& `
; D# c5 X) }# E7 b) N5 `
& E a4 {8 |% p$ Y7 {
) w5 N$ {' |( h) _+ H
" e7 @- v- _& z. u* ?3 `* H
+ K9 g. G+ i& ?) b4 c, H3 N/ v( g9 n1 {6 S* h
/ k6 A. R% o& ~: s) Z: F `
( Y0 f) \, v& D4 p: s
/ v# X1 M' C l, Z# r7 r0 _4 q0 ` |
|