one cad 记录 实在记不住 代码还不好管理,也是无奈


step 1 : String Is_SaveCheckOK='N'   全局 

setp 2 : 绑定 vth 国家列表

dbd2140 in ssdpbb1110。pbl
 select company, company_nm from visit_master_company where company = '' 

  uf_get_search_info('H',Ls_country,dw_7)

event keydown;string ls_country

if key=keyenter! then 
    
    ls_country=sle_country_txt.text
    uf_get_search_info('H',Ls_country,dw_7)
    
    if dw_7.rowcount()=1 then
        sle_country_txt.tag=string(dw_7.getitemstring(1,'code_id'))
        sle_country_txt.text=string(dw_7.getitemstring(1,'code_name'))
        Is_focus=''
        sle_country_txt.triggerevent(losefocus!)
        dw_7.visible = false
    end if
    
    //公司为其他时,备注显示公司名
    //if len(sle_company_u.tag) > 0 and sle_company_u.tag = 'CM00000066' then
    //    st_mo.text = '*公 司 名'
    //else
    //    st_mo.text = '备        注'
    //end if
end if
end event
选择国家  添加国家 及code 到控件 和 tag
1    C00046    朝鲜:North Korea    
2    C00079    伊朗:Iran    
3    C00169    叙利亚:Syria    
4    C00164    北苏丹:North Sultan    
5    C00001     阿富汗:Afghanistan    
6    C00002     阿尔巴尼亚:Albania    
7    C00003     阿尔及利亚:Algeria    
8    C00004     安道尔:Andorra    
9    C00005     安哥拉:Angola    
10    C00006     安提瓜和巴布达:Antigua and Barbuda    
11    C00007     阿根廷:Argentina    
12    C00008     亚美尼亚:Armenia    Y
13    C00009     澳大利亚:Australia    
14    C00010     奥地利:Austria    
15    C00011     阿塞拜疆:Azerbaijan    Y
16    C00012     巴哈马:Bahamas    
17    C00013     巴林:Bahrain    
18    C00014     孟加拉国:Bangladesh    
19    C00015     巴巴多斯:Barbados    
20    C00016     白俄罗斯:Belarus    Y
21    C00017     比利时:Belgium    
22    C00018     伯利兹:Belize    
23    C00019     贝宁:Benin    
24    C00020     不丹:Bhutan    
25    C00021     玻利维亚:Bolivia    
26    C00022     波斯尼亚和黑塞哥维那:Bosnia and Herzegovina    
27    C00023     博茨瓦纳:Botswana    
28    C00024     巴西:Brazil    
29    C00025     文莱:Brunei Darussalam    
30    C00026     保加利亚:Bulgaria    
31    C00027     布基纳法索:Burkina Faso    
32    C00028     布隆迪:Burundi    
33    C00029     佛得角:Cabo Verde    
34    C00030     柬埔寨:Cambodia    Y
35    C00031     喀麦隆:Cameroon    
36    C00032     加拿大:Canada    
37    C00033     中非共和国:Central African Republic    
38    C00034     乍得:Chad    
39    C00035     智利:Chile    
40    C00036     中国:China    
41    C00037     哥伦比亚:Colombia    
42    C00038     科摩罗:Comoros    
43    C00039     刚果(布):Congo    
44    C00040     哥斯达黎加:Costa Rica    
45    C00041     科特迪瓦:Cote d'Ivoire    
46    C00042     克罗地亚:Croatia    
47    C00043     古巴:Cuba    
48    C00044     塞浦路斯:Cyprus    
49    C00045     捷克:Czech Republic    
50    C00047     刚果(金):Democratic Republic of the Congo    
51    C00048     丹麦:Denmark    
52    C00049     吉布提:Djibouti    
53    C00050     多米尼克:Dominica    
54    C00051     多米尼加:Dominican Republic    
55    C00052     厄瓜多尔:Ecuador    
56    C00053     埃及:Egypt    
57    C00054     萨尔瓦多:El Salvador    
58    C00055     赤道几内亚:Equatorial Guinea    
59    C00056     厄立特里亚:Eritrea    
60    C00057     爱沙尼亚:Estonia    
61    C00058     埃塞俄比亚:Ethiopia    
62    C00059     斐济:Fiji    
63    C00060     芬兰:Finland    
64    C00061     法国:France    
65    C00062     加蓬:Gabon    
66    C00063     冈比亚:Gambia    
67    C00064     格鲁吉亚:Georgia    Y
68    C00065     德国:Germany    
69    C00066     加纳:Ghana    
70    C00067     希腊:Greece    
71    C00068     格林纳达:Grenada    
72    C00069     危地马拉:Guatemala    
73    C00070     几内亚:Guinea    
74    C00071     几内亚比绍:Guinea-Bissau    
75    C00072     圭亚那:Guyana    
76    C00073     海地:Haiti    
77    C00074     洪都拉斯:Honduras    
78    C00075     匈牙利:Hungary    
79    C00076     冰岛:Iceland    
80    C00077     印度:India    
81    C00078     印尼:Indonesia    
82    C00080     伊拉克:Iraq    Y
83    C00081     爱尔兰:Ireland    
84    C00082     以色列:Israel    
85    C00083     意大利:Italy    
86    C00084     牙买加:Jamaica    
87    C00085     日本:Japan    
88    C00086     约旦:Jordan    
89    C00087     哈萨克斯坦:Kazakhstan    Y
90    C00088     肯尼亚:Kenya    
91    C00089     基里巴斯:Kiribati    
92    C00090     韩国:Republic of Korea    
93    C00091     科威特:Kuwait    
94    C00092     吉尔吉斯斯坦:Kyrgyzstan    Y
95    C00093     老挝:Lao People's Democratic Republic    Y
96    C00094     拉脱维亚:Latvia    
97    C00095     黎巴嫩:Lebanon    
98    C00096     莱索托:Lesotho    
99    C00097     利比里亚:Liberia    
100    C00098     利比亚:Libya    Y
101    C00099     列支敦士登:Liechtenstein    
102    C00100     立陶宛:Lithuania    
103    C00101     卢森堡:Luxembourg    
104    C00102     马达加斯加:Madagascar    
105    C00103     马拉维:Malawi    
106    C00104     马来西亚:Malaysia    
107    C00105     马尔代夫:Maldives    
108    C00106     马里:Mali    
109    C00107     马耳他:Malta    
110    C00108     马绍尔群岛:Marshall Islands    
111    C00109     毛里塔尼亚:Mauritania    
112    C00110     毛里求斯:Mauritius    
113    C00111     墨西哥:Mexico    
114    C00112     密克罗尼西亚联邦:Micronesia    
115    C00113     摩尔多瓦:Republic of Moldova    Y
116    C00114     摩纳哥:Monaco    
117    C00115     蒙古国:Mongolia    Y
118    C00116     黑山:Montenegro    
119    C00117     摩洛哥:Morocco    
120    C00118     莫桑比克:Mozambique    
121    C00119     缅甸:Myanmar    Y
122    C00120     纳米比亚:Namibia    
123    C00121     瑙鲁:Nauru    
124    C00122     尼泊尔:Nepal    
125    C00123     荷兰:Netherlands    
126    C00124     新西兰:New Zealand    
127    C00125     尼加拉瓜:Nicaragua    
128    C00126     尼日尔:Niger    
129    C00127     尼日利亚:Nigeria    
130    C00128     北马其顿:North Macedonia    
131    C00129     挪威:Norway    
132    C00130     阿曼:Oman    
133    C00131     巴基斯坦:Pakistan    
134    C00132     帕劳:Palau    
135    C00133     巴拿马:Panama    
136    C00134     巴布亚新几内亚:Papua New Guinea    
137    C00135     巴拉圭:Paraguay    
138    C00136     秘鲁:Peru    
139    C00137     菲律宾 :Philippines    
140    C00138     波兰:Poland    
141    C00139     葡萄牙:Portugal    
142    C00140     卡塔尔:Qatar    
143    C00141     罗马尼亚:Romania    
144    C00142     俄罗斯:Russian Federation    Y
145    C00143     卢旺达:Rwanda    
146    C00144     圣基茨和尼维斯:Saint Kitts and Nevis    
147    C00145     圣卢西亚:Saint Lucia    
148    C00146     圣文森特和格林纳丁斯:Saint Vincent and the Grenadines    
149    C00147     萨摩亚:Samoa    
150    C00148     圣马力诺:San Marino    
151    C00149     圣多美和普林西比:Sao Tome and Principe    
152    C00150     沙特阿拉伯:Saudi Arabia    
153    C00151     塞内加尔:Senegal    
154    C00152     塞尔维亚:Serbia    
155    C00153     塞舌尔:Seychelles    
156    C00154     塞拉利昂:Sierra Leone    
157    C00155     新加坡:Singapore    
158    C00156     斯洛伐克:Slovakia    
159    C00157     斯洛文尼亚:Slovenia    
160    C00158     所罗门群岛:Solomon Islands    
161    C00159     索马里:Somalia    
162    C00160     南非:South Africa    
163    C00161     南苏丹:South Sudan    
164    C00162     西班牙:Spain    
165    C00163     斯里兰卡 :Sri Lanka    
166    C00165     苏里南:Suriname    
167    C00166     斯威士兰:Swaziland    
168    C00167     瑞典:Sweden    
169    C00168     瑞士:Switzerland    
170    C00170     塔吉克斯坦:Tajikistan    Y
171    C00171     坦桑尼亚:United Republic of Tanzania    
172    C00172     泰国:Thailand    
173    C00173     东帝汶:Timor-Leste    
174    C00174     多哥:Togo    
175    C00175     汤加:Tonga    
176    C00176     特立尼达和多巴哥:Trinidad and Tobago    
177    C00177     突尼斯:Tunisia    
178    C00178     土耳其:Turkey    
179    C00179     土库曼斯坦:Turkmenistan    Y
180    C00180     图瓦卢:Tuvalu    
181    C00181     乌干达:Uganda    
182    C00182     乌克兰:Ukraine    Y
183    C00183     阿联酋:United Arab Emirates    
184    C00184     英国:United Kingdom of Great Britain and Northern Ireland    
185    C00185     美国:United States of America    
186    C00186     乌拉圭:Uruguay    
187    C00187     乌兹别克斯坦:Uzbekistan    Y
188    C00188     瓦努阿图:Vanuatu    
189    C00189     委内瑞拉:Venezuela (Bolivarian Republic of)    
190    C00190     越南:Viet Nam    Y
191    C00191     也门:Yemen    
192    C00192     赞比亚:Zambia    
193    C00193     津巴布韦:Zimbabwe    
  国家代码
string Ls_sql

//用户列表
if as_flag = 'A' then
     Ls_sql += "  SELECT VISIT_IDENT,                                                                                                                                                                                             " 
     Ls_sql += "   CASE WHEN LENGTH(visit_ident) < 7 THEN visit_ident ELSE  CASE WHEN IDENT_TYPE = 'IT01' THEN VISIT_IDENT ELSE SUBSTR(VISIT_IDENT,1,3) || LPAD('*', LENGTH(VISIT_IDENT) - 7,'*') ||SUBSTR(VISIT_IDENT,LENGTH(VISIT_IDENT)-3, 4) END end  VISIT_IDENT_JM, VISIT_NAME      " 
     Ls_sql += "   FROM  VISIT_MASTER_USER                                                                                                                                                                                        " 
     Ls_sql += "  WHERE  (VISIT_IDENT LIKE '%'||'"+as_search+"'||'%'                                                                                                                                                                    " 
     Ls_sql += "  or  VISIT_NAME LIKE '%'||'"+as_search+"'||'%' ) " 
//     Ls_sql += "  union  " 
//     Ls_sql += "  select user_id VISIT_IDENT, user_id VISIT_IDENT_JM, user_name VISIT_NAME " 
//     Ls_sql += "  from comm_master_user where (user_id like '%'||'"+as_search+"'||'%'  or user_name like '%'||'"+as_search+"'||'%'  )  "  
     
//公司列表
elseif as_flag = 'B' then
    Ls_sql += "  SELECT company, company_nm                                                                 "   
    Ls_sql += "   FROM  visit_master_company                                                                "   
    Ls_sql += "  WHERE  use_yn = 'Y' AND COMPANY LIKE 'CM%' AND ( company_nm like '%'||'"+as_search+"'||'%'       "   
    Ls_sql += "     OR  company like '%'||'"+as_search+"'||'%' )                                                  "  
//    Ls_sql +="  UNION                                                                                    " 
//    Ls_sql +="  SELECT DEPT_CODE, DEPT_NAME                                                              " 
//    Ls_sql +="   FROM  comm_master_dept                                                                  " 
//    Ls_sql +="  WHERE  STATUS = 'Y' AND dept_type = 'CP'    " 

//部门列表
elseif as_flag = 'C' then
    Ls_sql += " SELECT DEPT_CODE, DEPT_NAME                                                            " 
    Ls_sql += "  FROM  comm_master_dept                                                                " 
    Ls_sql += " WHERE  STATUS = 'Y' AND dept_type <> 'SP' AND ( DEPT_CODE like '%'||'"+as_search+"'||'%'     " 
    Ls_sql += "    OR  DEPT_NAME like '%'||'"+as_search+"'||'%' )                                            " 

//公司+部门
elseif as_flag = 'D' then
    Ls_sql +="  SELECT company, company_nm                                                               " 
    Ls_sql +="   FROM  visit_master_company                                                              " 
    Ls_sql +="  WHERE  use_yn = 'Y' AND COMPANY LIKE 'CM%' AND ( company_nm like '%'||'"+as_search+"'||'%'     " 
    Ls_sql +="     OR  company like '%'||'"+as_search+"'||'%' )                                                " 
    Ls_sql +="  UNION                                                                                    " 
    Ls_sql +="  SELECT DEPT_CODE, DEPT_NAME                                                              " 
    Ls_sql +="   FROM  comm_master_dept                                                                  " 
    Ls_sql +="  WHERE  STATUS = 'Y' AND dept_type <> 'SP' AND ( DEPT_CODE like '%'||'"+as_search+"'||'%'       " 
    Ls_sql +="     OR  DEPT_NAME like '%'||'"+as_search+"'||'%' )                                              " 

//系统用户列表
elseif as_flag = 'E' then
     Ls_sql += "  select user_id VISIT_IDENT, user_id VISIT_IDENT_JM, user_name VISIT_NAME " 
     Ls_sql += "  from comm_master_user where (user_id like '%'||'"+as_search+"'||'%'  or user_name like '%'||'"+as_search+"'||'%'  )  "  
     
//用户列表(含HP_ID)
elseif as_flag = 'F' then
     Ls_sql += "  SELECT VISIT_IDENT,                                                                                                                                                                                             " 
     Ls_sql += "   CASE WHEN LENGTH(visit_ident) < 7 THEN visit_ident ELSE  CASE WHEN IDENT_TYPE = 'IT01' THEN VISIT_IDENT ELSE SUBSTR(VISIT_IDENT,1,3) || LPAD('*', LENGTH(VISIT_IDENT) - 7,'*') ||SUBSTR(VISIT_IDENT,LENGTH(VISIT_IDENT)-3, 4) END end  VISIT_IDENT_JM, VISIT_NAME,HP_EMP_ID      " 
     Ls_sql += "   FROM  VISIT_MASTER_USER                                                                                                                                                                                        " 
     Ls_sql += "  WHERE  (VISIT_IDENT LIKE '%'||'"+as_search+"'||'%'  OR HP_EMP_ID LIKE  '%'||'"+as_search+"'||'%'                                                                                                                      " 
     Ls_sql += "  or  VISIT_NAME LIKE '%'||'"+as_search+"'||'%' ) " 

//用户列表(含HP_ID)
elseif as_flag = 'H' then
     Ls_sql += " SELECT    CODE_ID,CODE_NAME,MO  FROM comm_master_code_manage where prefix = 'BB17'                " 
     Ls_sql += "   AND  (CODE_NAME LIKE '%'||'"+as_search+"'||'%'       " 
     Ls_sql += "  or  CODE_ID LIKE '%'||'"+as_search+"'||'%' ) "     

//用户列表(含HP_ID)
elseif as_flag = 'I' then
     Ls_sql += " SELECT    CODE_ID company,CODE_NAME company_nm,MO  FROM comm_master_code_manage where prefix = 'BB17'                " 
     Ls_sql += "   AND  (CODE_NAME LIKE '%'||'"+as_search+"'||'%'       " 
     Ls_sql += "  or  CODE_ID LIKE '%'||'"+as_search+"'||'%' ) "     
end if

as_dw.SetTransObject(sqlca)
as_dw.SetSqlSelect(Ls_sql)    
as_dw.retrieve() 
检查国家

step 3: function  wf_get_user_info 

setp 4 : 调用 step3 新增 

public subroutine wf_get_user_info (string as_flag, string as_visit_ident, string as_country_id)
end prototypes

public subroutine wf_get_user_info (string as_flag, string as_visit_ident, string as_country_id);int Li_cnt
int Li_Countrycnt
int Li_CountryConfirm
String Li_countryName_like
String Ls_ident,Ls_emp_type,Ls_ident_type,Ls_sex,Ls_visit_name, Ls_company,Ls_company_nm,Ls_user_name
String Ls_phone_no,Ls_image_yn,Ls_visit_image_path
String Ls_countryAuto_Code,Ls_countryAuto_Name

int Li_cnt
int Li_Countrycnt
int Li_CountryConfirm
String Li_countryName_like
String Ls_ident,Ls_emp_type,Ls_ident_type,Ls_sex,Ls_visit_name, Ls_company,Ls_company_nm,Ls_user_name
String Ls_phone_no,Ls_image_yn,Ls_visit_image_path
String Ls_countryAuto_Code,Ls_countryAuto_Name

//---------------------------------------------------------------------------------------------------------------------------------带出人员信息 、确认blacklist 
if as_flag = 'A' then
    SELECT COUNT(*)  into :Li_cnt            
    FROM VISIT_BLACKLIST                
    WHERE BLACK_YN = 'Y'         
    AND start_dt <= TO_CHAR(SYSDATE,'yyyymmdd') AND end_dt >= TO_CHAR(SYSDATE,'yyyymmdd')           
    AND visit_ident LIKE :as_visit_ident  ;
    
    if Li_cnt >0 then
        messagebox("Confirm", "该人员已被列为黑名单,不能预约", Stopsign!)
        Return
    end if
    
    ////////////////////////////////////////////////////////////////////////////////////////////////////

    ////////////////////////////////////////////////////////////////////////////////////////////////////    
    
    If as_country_id <> 'VTH_noCheck' then
        
            Is_SaveCheckOK = 'N'
    
    
        Li_countryName_like ="%" + sle_country_txt.text   +"%" 
    
    
        Select COUNT( * )  into        :Li_CountryConfirm
        FROM comm_master_code_manage
        WHERE  1 = 1
        And  prefix = 'BB17'          
        And CODE_NAME LIKE  :Li_countryName_like  ;
        
        If Li_CountryConfirm <> 1 Then
            Is_SaveCheckOK = 'N'
             messagebox("Confirm", " 请选择正确国籍 " )  //+  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt)+" " + Is_SaveCheckOK  )
            Return
        End If
                    Li_countryName_like = "%China%"
        If Len(sle_country_txt.tag) <> 6 Or IsNull(sle_country_txt.text) = True Then
            Is_SaveCheckOK = 'N'
            messagebox("Confirm", " 请选择国籍" )    // +  sle_country_txt.tag + " "+ Li_countryName_like + "  " )
            Return
        End If
                     //messagebox("Confirm", "2.5请选择正确国籍 " +  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt) +" " + Is_SaveCheckOK )
        //If          Is_SaveCheckOK <> 'N'  then
            
            Li_countryName_like = "%China%"

            Select COUNT( * )  into                 :Li_Countrycnt
            FROM comm_master_code_manage
            WHERE MO = 'Y'         
            And  prefix = 'BB17'          
            And CODE_ID = :as_country_id   And CODE_NAME Not Like :Li_countryName_like;

                If Li_Countrycnt > 0 Then
                    
                                 //messagebox("Confirm", "3 请选择正确国籍 " +  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt)+" " + Is_SaveCheckOK )
                                     
                    If Len(sle_vth_txt.text) < 5  or Len(sle_vth_txt.text) > 40 Then
                        messagebox("Confirm",  sle_country_txt.text+" "+"国籍人员存在VTH管理,请输入正确VTH Number"  )  //+" " + Is_SaveCheckOK )
                        Is_SaveCheckOK = 'N'
                        Return
                    Else
                                         //messagebox("Confirm", "4 请选择正确国籍 " +  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt) +" " + Is_SaveCheckOK )
                        Is_SaveCheckOK = 'Y'
                    End If
                                           //messagebox("Confirm", "4.5 请选择正确国籍 " +  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt) +" " + Is_SaveCheckOK )    
                Else
                                     //messagebox("Confirm", "5 请选择正确国籍 " +  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt) +" " + Is_SaveCheckOK )
                    Is_SaveCheckOK = 'Y'
                    If Len(sle_vth_txt.text) > 0    Then
                                         //messagebox("Confirm", "6 请选择正确国籍 " +  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt)+" " + Is_SaveCheckOK  )
                        sle_vth_txt.text = ''    
                    End If
                          
                                           //messagebox("Confirm", "6.7请选择正确国籍 " +  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt) +" " + Is_SaveCheckOK )    
                End If
                                      //messagebox("Confirm", "6.8请选择正确国籍 " +  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt) +" " + Is_SaveCheckOK )    
                                    //else
                                        //messagebox("Confirm", "6.85 " +Is_SaveCheckOK  +string(Len(Is_SaveCheckOK)))
                                 // Is_SaveCheckOK = 'N'
                // messagebox("Confirm", "6.9请选择正确国籍 " +  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt) +" " + Is_SaveCheckOK )    
                  //return
                             // End If
Else
             //    messagebox("Confirm", "7请选择正确国籍 " +  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt) +" " + Is_SaveCheckOK )
                 Is_SaveCheckOK = 'Y'
End If

            // messagebox("Confirm", "8请选择正确国籍 " +  sle_country_txt.tag + " "+ Li_countryName_like + "  " + string(Li_CountryConfirm) + " "+ string(Li_Countrycnt) + Is_SaveCheckOK )
    ////////////////////////////////////////////////////////////////////////////////////////////////////

                            
    SELECT A.VISIT_IDENT,A.IDENT_TYPE,A.VISIT_NAME,A.EMP_TYPE,A.COMPANY, 
            (SELECT COMPANY_NM FROM VISIT_MASTER_COMPANY WHERE COMPANY = A.COMPANY) COMPANY_NM,
             A.PHONE_NO,A.SEX,A.VISIT_IMAGE_YN,A.VISIT_IMAGE_PATH 
        into :Ls_ident, :Ls_ident_type,  :Ls_visit_name, :ls_emp_type,  :Ls_company, :Ls_company_nm    ,
              :Ls_phone_no, :Ls_sex,:Ls_image_yn, :Ls_visit_image_path
     FROM VISIT_MASTER_USER A                                                                                                                                                                                                                                                                          
     WHERE A.VISIT_IDENT = :as_visit_ident  AND  USE_YN = 'Y' ;

    
    sle_zjhm.text = Ls_ident
    sle_zjhm.tag = Ls_ident
    
    
    SELECT
    //A.VISIT_IDENT,
    //   A.IDENT_TYPE,
     //    A.VISIT_NAME,
     //    A.EMP_TYPE,
     //    A.COMPANY,
     //    (SELECT COMPANY_NM
     //       FROM VISIT_MASTER_COMPANY
     //      WHERE COMPANY = A.COMPANY)
     //       COMPANY_NM,
     //    A.PHONE_NO,
      //   A.SEX,
     //    A.VISIT_IMAGE_YN,
       //  A.VISIT_IMAGE_PATH,
       (SELECT MAX (COUNTRY_CODE) COUNTRY_CODE
          FROM VISIT_INOUT_HEAD
         WHERE VISIT_IDENT = A.VISIT_IDENT AND COUNTRY_CODE IS NOT NULL)
          COUNTRY_CODE,
       (SELECT CODE_NAME
          FROM COMM_MASTER_CODE_MANAGE
         WHERE     PREFIX = 'BB17'
               AND CODE_ID =
                      (SELECT MAX (COUNTRY_CODE) COUNTRY_CODE
                         FROM VISIT_INOUT_HEAD
                        WHERE     VISIT_IDENT = A.VISIT_IDENT
                              AND COUNTRY_CODE IS NOT NULL))
          COUNTRY_NAME 
                     into :Ls_countryAuto_Code, :Ls_countryAuto_Name
  FROM VISIT_MASTER_USER A
 WHERE A.VISIT_IDENT = :as_visit_ident  and USE_YN = 'Y' ;
    
        sle_country_txt.text = Ls_countryAuto_Name
    sle_country_txt.tag = Ls_countryAuto_Code
    
        dw_7.triggerevent(losefocus!)

    
    if Ls_emp_type = 'S070' then 
        rb_visit_gategory_ls.checked = true
        rb_visit_gategory_ch.checked = false
        rb_visit_gategory_ls.triggerevent (clicked!)
    elseif Ls_emp_type = 'S040' then
        rb_visit_gategory_ls.checked = false
        rb_visit_gategory_ch.checked = true
        rb_visit_gategory_ch.triggerevent (clicked!)
    end if
    
    sle_chn_name.text = Ls_visit_name
    
    sle_company_u.tag = Ls_company
    sle_company_u.text= Ls_company_nm
    Is_focus=''
    dw_2.triggerevent(losefocus!)

    if Ls_ident_type = rb_ident_type_sh.tag then
        rb_ident_type_sh.checked = true
        rb_ident_type_sf.checked = false
        rb_ident_type_hz.checked = false
        rb_ident_type_jz.checked = false
    elseif Ls_ident_type = rb_ident_type_sf.tag then
        rb_ident_type_sh.checked = false
        rb_ident_type_sf.checked = true
        rb_ident_type_hz.checked = false
        rb_ident_type_jz.checked = false
    elseif Ls_ident_type = rb_ident_type_hz.tag then
        rb_ident_type_sh.checked = false
        rb_ident_type_sf.checked = false
        rb_ident_type_hz.checked = true
        rb_ident_type_jz.checked = false
    elseif Ls_ident_type = rb_ident_type_jz.tag then
        rb_ident_type_sh.checked = false
        rb_ident_type_sf.checked = false
        rb_ident_type_hz.checked = false
        rb_ident_type_jz.checked = true
    end if
    
    sle_phone_no.text = Ls_phone_no
    
    if Ls_sex = rb_man.tag then
        rb_man.checked = true
        rb_female.checked = false
    elseif Ls_sex = rb_female.tag then
        rb_man.checked = false
        rb_female.checked = true
    end if
    
     if Ls_image_yn = 'Y' then
        //照片显示
        if uf_get_ftp_image (Ls_visit_image_path,p_pic) < 0 then
            p_pic.picturename = 'C:\SSDPCARD\image\admin_photo_box.jpg'
            p_pic2.visible = true
        else
            p_pic2.visible = false
        end if
    else
        p_pic.picturename = 'C:\SSDPCARD\image\admin_photo_box.jpg'
        p_pic2.visible = true
    end if
else  //--------------------------------------------------------------------------------------------------------------------------------------预约人信息
    
     SELECT b.dept_name, a.USER_NAME
     into :Ls_company_nm, :Ls_user_name
    FROM COMM_MASTER_USER a, comm_master_dept b      
    WHERE a.DEPART = b.dept_code(+)                   
    AND a.user_id LIKE :as_visit_ident  ;                 

        //MessageBox("Confirm","----1----" + Ls_company_nm +  Ls_user_name + Gs_userId )
        
    sle_receiver_dept.text=Ls_company_nm
    sle_receiver.text = Ls_user_name
    sle_receiver.tag = as_visit_ident
    dw_4.visible = false
    
    
end if

wf_get_user_info 

step5: 新增后保存

        //messagebox("Confirm", "1该人员已被列为黑名单,不能预约    "+ sle_receiver.text + "    " + sle_receiver.tag)
        //

if Is_mode = 'S' then 
    messagebox('确认','只有新增预约的时候才能保存!')
    return 
end if
        //messagebox("Confirm", "2该人员已被列为黑名单,不能预约    "+ sle_receiver.text + "    " + sle_receiver.tag)
    wf_get_user_info('A',sle_visit_user_s.tag,sle_country_txt.tag)
            //messagebox("Confirm", "3该人员已被列为黑名单,不能预约    "+ sle_receiver.text + "    " + sle_receiver.tag)
    if         Is_SaveCheckOK <>  'Y'  then
            messagebox('确认','请确认国籍和VTH Number!')
            Is_SaveCheckOK =  'N'
            return 
    end if
            Is_SaveCheckOK =  'N'
IF messagebox("Confirm", "确定要保存吗? " , Question!, YesNo!, 1) = 2 THEN RETURN

dw_1.accepttext()

// GET APRV SEQ
SELECT 'VPRQ'||TO_CHAR(SYSDATE,'YYMMDD')||NVL(LTRIM(TO_CHAR(TO_NUMBER(SUBSTR(MAX(APRV_SEQ),11,4))+1,'0000' )),'0001')
     INTO :Ls_aprv_seq
    FROM VISIT_INOUT_HEAD
WHERE APRV_SEQ LIKE 'VPRQ'||TO_CHAR(SYSDATE,'YYMMDD')||'%';  
        //messagebox("Confirm", "4该人员已被列为黑名单,不能预约    "+ sle_receiver.text + "    " + sle_receiver.tag)
if sqlca.sqlcode <> 0 then
    rollback using sqlca;
    MessageBox("Confirm","As select, there is an error(VISIT_INOUT_HEAD) (" + string(sqlca.sqlerrtext)+ ") ")
    return
end if        

        //messagebox("Confirm", "5该人员已被列为黑名单,不能预约    "+ sle_receiver.text + "    " + sle_receiver.tag)

相关