Generation of series (1, 2, 3... N) application instances, Application Instances
Take the number of series @ {sn: favorite} and put it in the bag doc.
<bag id=doc><we name=we_id>@{sn:favorite}</we></bag>
If the number of series @ {doc: we_id} is null, the maximum value of the we_id field in the primary key of the favorite_base table is queried. Initialization @ {sn: favorite =
@ {Pk: favorite_id}} Series
<if x="@{doc:we_id}"><we><esql module=base id=pk commit=true>Select max(WE_ID) as favorite_id from favorite_base</esql><bag id=doc><we name=we_id>@{sn:favorite=@{pk:favorite_id}}</we></bag></we></if>
Insert the number of systems and related content separately
Favorite_base,
Favorite_userTable
<ESql module=base act=edit commit=true>Insert Into favorite_base(we_id,title,words,content,words_content)Values(@{doc:we_id:int},@{pPage:title:string},@{pPage:words:string},@{pPage:content:memo},@{pPage:words_content:memo})</ESql><bag id=pPage><we name=content1>@{intLeft:@{pPage:content1}(580)}</we></bag><ESql module=base act=edit>Insert Into favorite_user(f_id,author,tree_id,ondate,memo)Values('@{doc:we_id}','@{session:user_id}','@{pPage:n}','@{sys:date}',@{pPage:content1:memo})</ESql>
Complete code
<Html> <chtml> <if x = "@ {session: user_id}" else = 1> <script> alert ("Log on first! "); Top. location. href = "@ {sys: path}"; </script> <we> <bag id = doc> <we name = we_id >@{ sn: favorite} </we> </bag> <if x = "@ {doc: we_id} "> <we> <esql module = base id = pk commit = true> Select max (WE_ID) as favorite_id from favorite_base </esql> <bag id = doc> <we name = we_id >@{ sn: favorite =@{ pk: favorite_id }}</we> </bag> </we> </if> <! -- Word segmentation --> <call> doc2words </call> <ESql module = base act = edit commit = true> Insert Into favorite_base (we_id, title, words, content, words_content) values (@ {doc: we_id: int}, @ {pPage: title: string}, @ {pPage: words: string}, @ {pPage: content: memo }, @ {pPage: words_content: memo}) </ESql> <bag id = pPage> <we name = content1 >@{ intLeft :@{ pPage: content1} (580 )} </we> </bag> <ESql module = base act = edit> Insert Into favorite_user (f_id, author, Tree_id, ondate, memo) Values ('@ {doc: we_id}', '@ {session: user_id}', '@ {pPage: n }', '@ {sys: date}', @ {pPage: content1: memo}) </ESql> <to >@{ sys: path }@{ sys: curpath1_blogs.html? N = @ {pPage: n} & myid = @ {session: user_id }</to> </we> </if> </chtml> File (blog_add_save.chtml) in the site/blog directory of the B2C e-commerce website, use the relevant files to experience it
Download Easy Do IT resources
Platform and the latest development manual free download: http://download.csdn.net/detail/tx18/8464425
Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8318585
The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please note thatDownload the latest version