2013年12月13日 星期五

asp-type


asp-data-type asp-variable-type

dim i,s,a
i = 1
s = "Hello world"
a = split("Hello World"," ")

WScript.Echo TypeName(i) 'Displays "Integer"
WScript.Echo TypeName(s) 'Displays "String"
WScript.Echo TypeName(a) 'Displays "Variant()

2013年12月12日 星期四

generator-list with input button


List

0.5,PAYMENT_TERMS.CREATE,button,0,0,:Create New Payment Terms,, {subformWidth}900{/subformWidth}{subformHeight}650{/subformHeight}{subform}input.jsp?mode=SINPUT&input=paymentTerms.txt&config=paymentTermsConfig.txt&{/subform}
0.61,PAYMENT_TERMS.CODE,text:GRID,5,100,Code
0.61,PAYMENT_TERMS.DESCRIPTION,text:GRID,50,150,Description

List.config

Title=Payment Terms
GridHeight=480px
FontSize=16px
PageFrameHeight=300px
PageBackGroundColor=#e1e1e1
FormWidth=98%
LABEL_WIDTH=10px
BodyTopMargin=20px
LineSpacing=3px
modalWidth=900
modalHeight=650
PreviouField=null
NextField=null
FocusBackGroundColor=#abcdef
GridRowHighLight=RGB(255,255,187)
GridStyle=width:85%; margin:auto;,width:85%; margin:auto;
InputTextHeight=20px
key=status
keyValue=true
where=where status:`D`
ListSubFormName=paymentTerms.txt
ListSubFormConfig=paymentTermsConfig.txt

Input

0.10,PAYMENT_TERMS.doc_no,text,5%,8,doc_no,,
0.20,PAYMENT_TERMS.CODE,text,20%:100px:100px,10,Code,,{required}
0.30,PAYMENT_TERMS.DESCRIPTION,text,100%:200px:400px,40,Description,,{required}


Inpuy.config

Title=Payment Terms
GridHeight=140px
FontSize=12px
PageFrameHeight=530px
PageBackGroundColor=#e1e1e1
FormWidth=90%
LABEL_WIDTH=120px
BodyTopMargin=45px
LineSpacing=3px
PreviouField=null
NextField=null
FocusBackGroundColor=#abcdef
GridRowHighLight=RGB(255,255,187)
LabelFontSize=12px
EachLineHeight=4px
InputTextRadius=1px
key= DOC_NO
InvisibleRetrivalNumber=1
InputTextHeight=24px
InputTextHeight=18px
ReadonlyCssStyle=color:black; background:#dddddd;











2013年12月11日 星期三

jquery-json example check userid user id had create or not



       s="tableRead?     db=erp&table=USER&fields=login_id&key=login_id&value='"+s1+"'&format=S&callback=?";


s="tableRead?"+
"db=erp&table=USER&"+
"fields=login_id&"+
"key=login_id&"+
"value='"+s4+"'&"+
"where= where login_id:`"+s4+"` and db: `"+s5+"` &" +
"format=S&callback=?";

$.getJSON(s,
function(data) {
if (data[0]){
$("#dialog").dialog( "open" );
$("#dialog").dialog('option', 'title', 'User Add  Message');
$("#dialog p").html("This user account had created !!");
return false;
}
}
)

javascript-datetimer-unique


it is generate from time

c=milliseconds = new Date().getTime(); //generate datetimer for master generate.datetimer


foxpro.gendao

para p_name
store 'VENDOR' TO P_NAME
STORE 'COMPANY_PROFILE'  TO P_NAME
store 'PAYMENT_TERMS' to P_NAME                                  
store 'PAYMENT_METHOD' to P_NAME                                  
STORE 'CUSTOMER'  TO P_NAME
store 'VENDOR' TO P_NAME
store 'RESOURCE' TO P_NAME
store 'ITEM' TO P_NAME
*STORE 'USER'  TO P_NAME
CLOS DATA
set dele on
use result in 0
use gendao in 0
sele gendao
dele for empty(field1)
SET FILTER TO tableNAME=P_NAME OR NAME=P_NAME
SCAN
if (not empty(name)) and empty(tablename)
replace tablename with name
replace name with ''
endif
if not empty(raw)

replace field1 with strt(strt(raw,'  `',''),'` ',' ')
replace field1 with strt(field1,'DEFAULT NULL','')
replace field1 with strt(field1,'NOT NULL','')
replace field1 with strt(field1,'varchar','C ')
replace field1 with strt(field1,'int(11)','I')
replace field1 with strt(field1,'char','c')
replace field1 with strt(field1,'bigint(20)','L')
endif
ENDSCAN
sele gendao
LOCATE FOR ALLT(upper(aarray(field1,1,' ')))=='RECORDID'
IF NOT FOUND()
INSERT INTO GENDAO (tableNAME,FIELD1,ZTYPE) VALUES (P_NAME,'RECORDID','FIELD')
*BROW FIELD ZTYPE
ENDIF

LOCATE FOR ALLT(upper(aarray(field1,1,' ')))=='DOC_NO'
IF NOT FOUND()
INSERT INTO GENDAO (tableNAME,FIELD1,ZTYPE) VALUES (P_NAME,'DOC_NO','FIELD')
ENDIF

LOCATE FOR ALLT(upper(aarray(field1,1,' ')))=='STATUS'
IF NOT FOUND()
INSERT INTO GENDAO (tableNAME,FIELD1,ZTYPE) VALUES (P_NAME,'STATUS','FIELD')
ENDIF

LOCATE FOR ALLT(upper(aarray(field1,1,' ')))=='TIMESTAMP'
IF NOT FOUND()
INSERT INTO GENDAO (tableNAME,FIELD1,ZTYPE) VALUES (P_NAME,'TIMESTAMP','FIELD')
ENDIF

*alter table PAYMENT_TERMS ADD COLUMN STATUS CHAR DEFAULT 'D'

*create table PAYMENT_TERMS ( TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,`DOC_NO` int(10) unsigned NOT NULL AUTO_INCREMENT ,CODE NVARCHAR(10) DEFAULT '',DUE_DATE_CALCULATION NVARCHAR(32) DEFAULT '',DISCOUNT_DATE_CALCULATION NVARCHAR(32) DEFAULT '',DISCOUNT_PERCENT FLOAT DEFAULT 0,DESCRIPTION NVARCHAR(50) DEFAULT '',CALC_PMT_DISC_ON_CR_MEMOS char DEFAULT '',BASE_DATE_CAPTION NVARCHAR(30) DEFAULT '',COD_PAYMENT char DEFAULT '',COD_CASHIERS_CHECK char DEFAULT '',RECORDID bigint(20) NOT NULL DEFAULT '0',
*PRIMARY KEY (`RECORDID`),
*KEY `DOC_NO` (`DOC_NO`) USING BTREE);

sele gendao
scan
replace field1 with strt(field1,' `',' ')
endscan
*strt(strt(raw,'  `',''),'` ',' ')

replace all ftype with 'BIG' FOR 'INT' $ FIELD1
REPLACE ALL FIELD1 WITH ALLT(FIELD1)
REPLACE ALL FIELD1 WITH STRT(FIELD1,'-','_')
REPLACE ALL FIELD1 WITH STRT(FIELD1,'_>_','_TO_')
REPLACE ALL FIELD1 WITH STRTRAN(FIELD1,space(4),'')
replace ALL fieldname with  STRT(SUBS(FIELD1,AT('TABLE',FIELD1)+5),'(','') , ZTYPE WITH 'TABLE' for 'TABLE' $ FIELD1
replace all fieldname with allt(fieldname)
replace all fieldname with strt(allt(fieldname),chr(9),'')
replace ALL classname  with  proper(fieldname) for 'TABLE' $ FIELD1
replace all fieldname with  LEFT(FIELD1,AT(' ',FIELD1)),ZTYPE WITH 'FIELD'  for (not 'TABLE' $ FIELD1) and (not 'ENGINE' $ FIELD1)
replace all ZTYPE WITH 'ENGINE'  for  'ENGINE' $ FIELD1
*replace all zvariable with  lower(fieldname) for ztype='FIELD'
replace all zvariable with  lower(fieldname)
replace all varName with "seqNum" for zvariable='msg_seq_no'
replace all varName with t2v(zvariable) for (not zvariable='msg_seq_no')
replace ALL classname with upper(left(varName,1))+subs(varName,2)  for ztype='FIELD' or ztype='TABLE'
sele gendao
scan
do case
case upper(aarray(field1,1,' '))='RECORDID'
replace fieldtype with "bigint(20) NOT NULL DEFAULT '0'"
replace javatype with "String"
case upper(aarray(field1,1,' '))='DOC_NO'
replace fieldtype with "int(10) NOT NULL DEFAULT '0'"
replace javatype with "int"

case upper(aarray(field1,1,' '))='STATUS'
replace fieldtype with "CHAR NOT NULL DEFAULT 'D'"
replace javatype with "char"


*alter table PAYMENT_TERMS ADD COLUMN STATUS CHAR DEFAULT 'D'

other
if aarray(field1,2,' ')='C' OR  aarray(field1,2,' ')='S'
replace fieldtype with 'NVARCHAR('+aarray(field1,3,' ')+") DEFAULT ''"
replace  javatype with 'String'
endif
if aarray(field1,2,' ')='D'
replace fieldtype with 'DOUBLE DEFAULT 0'
replace  javatype with 'double'
endif
if aarray(field1,2,' ')='c'
replace fieldtype with "char DEFAULT ''"
replace  javatype with 'char'
endif
if aarray(field1,2,' ')='I'
replace fieldtype with 'INTEGER DEFAULT 0'
replace  javatype with 'int'
endif

if aarray(field1,2,' ')='F'
replace fieldtype with 'FLOAT DEFAULT 0'
replace  javatype with 'float'
endif
if aarray(field1,2,' ')='L'
replace fieldtype with 'LONG'
replace  javatype with 'long'
endif
if upper(aarray(field1,2,' '))='DATE'
replace fieldtype with 'date'
replace javatype with 'Date'
endif
if upper(aarray(field1,2,' '))='C' and allt(upper(aarray(field1,3,' ')))=='1'
replace fieldtype with "char DEFAULT ''"
replace  javatype with 'char'
endif
endcase
Endscan

select result
locate for name=p_name
if not found()
insert into result (name) value (p_name)
endif
store  createtable() to _r
replace in result createtab with _r
store createbean() to _r
replace in result javabean with _r

sele result
brow
sele gendao
set filter to
*brow field field1:30,tablename:30,fieldname:30,classname:30, varname:30,fieldtype:30



function createbean()

select gendao
_delimiter=''
quota='"'
quota2="+"
r0=''
r1=''
r=''
store ''  to mclassname
scan

if ztype='TABLE'
r= r+'import java.util.Date;'+chr(13)

r=r+'public class '+allt(classname)+"  implements java.io.Serializable  {"+chr(13)
store allt(classname) to mclassname
else
r0=r0+" protected " + allt(javatype)+" "+allt(varname)+";"+chr(13)

r1=r1+"public void set"+allt(classname)+"("+allt(javatype)+" newValue){"+allt(varname)+" = newValue;}"+chr(13)
r1=r1+"public "+allt(javatype)+" get"+allt(classname)+"(){return "+allt(varname)+";}"+chr(13)+chr(13)

endif


endscan
r=r+r0+chr(13)
r=r+"public "+mclassname+"(){}"+chr(13)
r=r+r1+chr(13)+"}"
*public employee(){}
return r

*public class employee
*{*
* // select password, email,surname from employee;*
* protected  int theValue;
* protected  String password;
* protected  String email;
*







function createtable()
r= ''
select gendao
_delimiter=''
quota='"'
quota2="+"
scan
if ztype='TABLE'
r=r+quota+"create table "+allt(tablename) +' ( '+quota+quota2+chr(13)
else

do case
case LOWER(ALLT(fieldname))=='timestamp'
s='" '+_delimiter+'TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP "+'+CHR(13)

r=r+allt(s)




case LOWER(ALLT(fieldname))=='doc_no'
s=' `DOC_NO` int(10) unsigned NOT NULL AUTO_INCREMENT "+'+CHR(13)
r=r+'"'+_delimiter+allt(s)
other
s=fieldname
s=strt(s,'))',')')
s=strt(s,'((','(')

s0=fieldtype
s0=strt(s0,'))',')')
s0=strt(s0,'((','(')

r=r +quota+ _delimiter+allt(s)+' '+ALLT(s0)+quota+quota2+chr(13)
endcase


_delimiter=','
endif
endscan
r=r+quota+','+ "PRIMARY KEY (`RECORDID`)"+quota+quota2+chr(13)
r=r+'",KEY `DOC_NO` (`DOC_NO`) USING BTREE"+'+chr(13)
r=r+quota+');'+quota+";"+chr(13)
return r

function t2v()
para p_1
for i=0 to 25
p_1=strt(p_1,'_'+chr(97+i),chr(65+i))
endfor
r=p_1
return r

generator-list-sample-list


property.file
0.61,PAYMENT_TERMS.CODE,text:GRID,5,100,Code
0.61,PAYMENT_TERMS.DESCRIPTION,text:GRID,50,150,Description


config.file

key=status
keyValue='D'
where=where status:`D`



 call input.jsp?input=paymentTermsList.txt&config=paymentTermsListConfig.txt&mode=LIST

2013年12月8日 星期日

java-javabean-remove

javabean-destroy


<%
pageContext.removeAttribute("page_Teacher");
request.removeAttribute("request_Teacher");
session.removeAttribute("session_Teacher");
application.removeAttribute("application_Teacher");
 %>