国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

辦公自動化系統公文歸檔代碼

2024-07-21 02:16:26
字體:
來源:轉載
供稿:網友

商業源碼熱門下載www.html.org.cn

(由于長度限制,刪除了部分代碼)
'-----------------------------------------------------------------------------------------------------------------
'頁面初始代碼
'-----------------------------------------------------------------------------------------------------------------
private sub page_load(byval sender as system.object, byval e as system.eventargs) handles mybase.load

if not page.ispostback then
sqlconnection1.open()

receivedeptid = convert.tostring("dsgd1111ads")
userid = convert.todouble("af00000sra")
username = convert.tostring("1111").trim
'--------------------------------------------------------------------------------
ddl_year.items.add(convert.tostring(today().year - 2))
ddl_year.items.add(convert.tostring(today().year - 1))
ddl_year.items.add(convert.tostring(today().year))
ddl_year.items.add(convert.tostring(today().year + 1))
ddl_year.selectedindex = -1
ddl_year.items.findbyvalue(convert.tostring(today().year)).selected = true
bindgrid()
btn_reg.enabled = false
bindtree()
else
response.write("<script language=javascript>function init(){document.form1.page_pos.value = " + request("page_pos") + "; window.scrollby(0,document.form1.page_pos.value); }window.onload=init;</script>")
end if
end sub


'---------------------------------------------------------------------
'綁定公文表
'---------------------------------------------------------------------
private function bindgrid()
receivedeptid = convert.tostring("00550000")
dim tpcnt as integer
with new documentsystem()
tmpdpr = .getdocuarchiveinfo(receivedeptid, convert.tostring(ddl_year.selecteditem.value), "wait")
end with
if tmpdpr.tables(0).rows.count > 0 then
'btn_reg.enabled = true
l_tips.text = ""
tpcnt = tmpdpr.tables(0).rows.count / dg_dpr.pagesize
if tmpdpr.tables(0).rows.count mod dg_dpr.pagesize > 0 then
tpcnt = tpcnt + 1
end if
if tpcnt < dg_dpr.pagecount then
if dg_dpr.currentpageindex > tpcnt - 1 then
dg_dpr.currentpageindex = tpcnt - 1
end if
end if
else
btn_reg.enabled = false
l_tips.visible = true
l_tips.text = "現在沒有要歸檔得公文!"
end if
dg_dpr.datasource = tmpdpr
dg_dpr.databind()
if tmpdpr.tables(docupublishregdata.docupublishreg_table).rows.count = 0 then
l_pagecount.text = "共0頁!"
ib_first.visible = false
ib_pre.visible = false
ib_next.visible = false
ib_last.visible = false
label5.visible = false
tb_pageno.visible = false
label7.visible = false
ib_first.enabled = false
ib_pre.enabled = false
ib_next.enabled = false
ib_last.enabled = false
else
ib_first.visible = true
ib_pre.visible = true
ib_next.visible = true
ib_last.visible = true
label5.visible = true
tb_pageno.visible = true
label7.visible = true
ib_first.enabled = true
ib_pre.enabled = true
ib_next.enabled = true
ib_last.enabled = true
l_pagecount.text = "第" + convert.tostring(dg_dpr.currentpageindex + 1) + "頁!共" + convert.tostring(dg_dpr.pagecount) + "頁!"
if dg_dpr.currentpageindex + 1 = dg_dpr.pagecount then
ib_next.enabled = false
ib_last.enabled = false
end if
if dg_dpr.currentpageindex + 1 = 1 then
ib_pre.enabled = false
ib_first.enabled = false
end if
tb_pageno.text = convert.tostring(dg_dpr.currentpageindex + 1)
end if
tb_archive.text = ""
ddl_archive.selectedindex = -1
end function


'----------------------------------------------------------------------------------------------------------------
'歸檔按鈕點擊觸發事件
'----------------------------------------------------------------------------------------------------------------
private sub btn_reg_click(byval sender as system.object, byval e as system.eventargs) handles btn_reg.click

dim i as integer
dim j as integer

if lb_archivevalue.text = "" or lb_archivevalue.text <> convert.tostring(ddl_archive.selecteditem.value) then '必須初始化對象?

lb_archivename.text = "歸檔不成功,請先選擇檔案庫及案卷??!"
lb_archivename.visible = true
else
lb_archivename.visible = false
if dg_dpr.items.count > 0 then
dim checkdocuselected as boolean
checkdocuselected = false
for i = dg_dpr.items.count - 1 to 0 step -1
dim tmpdocuid as double = convert.todouble(dg_dpr.items(i).cells(4).text)
dim deptid as string = trim(dg_dpr.items(i).cells(3).text)
dim myremovecmd as checkbox = ctype(dg_dpr.items(i).findcontrol("cb_dj"), checkbox)
if myremovecmd.checked then
checkdocuselected = true
dim data as documentsdata
with new documentsystem()
data = .getdocumentbydocuid(convert.tostring(tmpdocuid))
end with

'將公文信息(除正文、附件)插入檔案系統數據庫
'---------------------------------------------
dim aaa as string
dim bbb as string
dim wid
dim b1 as string
dim a1 as string
dim a2 as string
dim a3 as string
dim a4 as string
dim a5 as string
dim a6 as string
dim a7 as string
dim a8 as string
dim a9 as string
dim a10 as string

b1 = convert.tostring(lb_filetablename.text).trim
a1 = guid.newguid.tostring
a2 = convert.tostring(lb_archivevalue.text).trim
a3 = convert.tostring(data.tables(0).rows(0).item("docutt")).trim
a4 = convert.tostring(data.tables(0).rows(0).item("keyword")).trim
a5 = convert.tostring(data.tables(0).rows(0).item("docusigner")).trim
a6 = convert.tostring(data.tables(0).rows(0).item("writedate")).trim
a7 = convert.tostring(data.tables(0).rows(0).item("dispatchyear")).trim
a8 = convert.tostring(data.tables(0).rows(0).item("dispatchdeptname")).trim()
a9 = "正文"
a10 = trim(dg_dpr.items(i).cells(1).text)
sqlinsertcommand1.commandtext = "insert into " & b1 & _
" (guid,relations,subject,mainword,duteman,filedate,years,filecomeunit,textfield,filenum,flags)" & _
" values ('" & a1 & "','" & a2 & "','" & a3 & "','" & a4 & "','" & a5 & "','" & a6 & "','" & a7 & "','" & a8 & "','" & a9 & "','" & a10 & "',2)"

sqlconnection1.open()
sqlinsertcommand1.executenonquery()
sqlconnection1.close()


'確定路徑并判斷文件夾是否存在
'--------------------------------------------------------
dim address as string
dim address1 as string
address = lb_filetablename.text
address1 = convert.tostring(session("file_save"))
address1 = address1 & address
if io.directory.exists(address1) = false then
io.directory.createdirectory(address1)
else
end if

'輸出公文正文
'-------------------------------------------------------
dim bytedata as byte()
bytedata = ctype(data.tables(0).rows(0).item("docucontent"), byte())
dim bytedatasize as long = bytedata.length
dim filename as string
filename = convert.tostring(data.tables(0).rows(0).item("docutitle")) & convert.tostring(data.tables(0).rows(0).item("filetype"))
dim fsdoc as filestream
fsdoc = new filestream(address1 & "/" & filename, filemode.create, fileaccess.write)
fsdoc.write(bytedata, 0, bytedatasize)
fsdoc.close()


'輸出公文附件
'-------------------------------------------------------
dim data1 as docuattachdata
with new documentsystem()
data1 = .getdocuattachbydocuid(convert.tostring(tmpdocuid))
end with
dim aid as string
if data1.tables(0).rows.count > 0 then
aid = convert.tostring(data1.tables(0).rows(0).item("aid"))
dim tmpdocuattachdata as docuattachdata
with new documentsystem()
tmpdocuattachdata = .getdocuattachcontentbyaid(convert.todouble(aid))
end with
if tmpdocuattachdata.tables(0).rows.count > 0 then

dim fname as string
for j = 0 to tmpdocuattachdata.tables(0).rows.count - 1
bytedata = ctype(tmpdocuattachdata.tables(0).rows(j).item("acontent"), byte())
bytedatasize = bytedata.length
fname = address1 & "/" & trim(convert.tostring(tmpdocuattachdata.tables(0).rows(j).item("filename")))
fsdoc = new filestream(fname, filemode.create, fileaccess.write)
fsdoc.write(bytedata, 0, bytedatasize)
fsdoc.close()
next
end if
end if

'修改公文歸檔狀態
'----------------------------------------------------------------------------------------------
dim dacuphasedata as documentphasedata
with new documentphasesystem()
dacuphasedata = .getdocumentphaseinfo(convert.todouble(tmpdocuid), "wait", "dpgd")
end with
dim phasedataid as documentphasedata
with new documentphasesystem()
if dacuphasedata.tables(0).rows.count > 0 then
phasedataid = .getphasebysequenceid(convert.todouble(dacuphasedata.tables(0).rows(0).item("sequenceid")))
phasedataid.tables(0).rows(0).item(phasedataid.currentstatus_field) = "over"
phasedataid.tables(0).rows(0).item(phasedataid.handlerid_field) = convert.todouble(session("userid"))
phasedataid.tables(0).rows(0).item(phasedataid.handler_field) = convert.tostring(session("username"))

' phasedataid.tables(0).rows(0).item(phasedataid.currentstatus_field) = "wait"
' phasedataid.tables(0).rows(0).item(phasedataid.handlerid_field) = system.dbnull.value 'convert.todouble(session("userid"))
' phasedataid.tables(0).rows(0).item(phasedataid.handler_field) = system.dbnull.value 'convert.tostring(session("username"))
end if
end with
dim updata as boolean
with new documentphasesystem()
updata = .updatedocumentphase(phasedataid)
if updata = true then
lb_archivename.text = "歸檔成功!"
lb_archivename.visible = true
end if
end with
end if
next
if checkdocuselected = false then
lb_archivename.text = "歸檔不成功,請先選擇要歸檔的公文!"
lb_archivename.visible = true
end if

end if

end if
bindgrid()
end sub


'----------------------------------------------------------------------------------------------------------------
'綁定樹結點
'----------------------------------------------------------------------------------------------------------------



'---------------------------------------------------------------------
'treeview1觸發事件
'---------------------------------------------------------------------
private sub treeview1_selectedindexchange(byval sender as system.object, byval e as microsoft.web.ui.webcontrols.treeviewselecteventargs) handles treeview1.selectedindexchange
btn_reg.enabled = true
lb_tablename.text = convert.tostring(treeview1.getnodefromindex(e.newnode).nodedata).trim
dim aaa as string '參數“length”必須大于或等于零!?。?br> aaa = convert.tostring(lb_tablename.text).trim
dim bbb as integer
bbb = aaa.length()
if bbb >= 2 then
lb_filetablename.text = "f_" & right(aaa, bbb - 2)
lb_filetablename.text = convert.tostring(lb_filetablename.text).trim
else
lb_tablename.text = ""
end if
lb_archivename.visible = false
bindarchive("", convert.tostring(lb_tablename.text))
end sub


'--------------------------------------------------------------------------------------------------------------------
'給ddl_archive下拉列表框綁定案卷數據
'--------------------------------------------------------------------------------------------------------------------
private function bindarchive(byval serch as string, byval tablename as string)
ddl_archive.items.clear()
dim cataitem1 as new listitem()
cataitem1.text = ""
cataitem1.value = ""
ddl_archive.items.add(cataitem1)
ddl_archive.selectedindex = -1
if tablename <> "" then
try
sqldataadapter1.selectcommand.commandtext = " select subject ,guid from " & tablename & " where subject like '%" & serch & "%' order by subject"
sqldataadapter1.fill(dataset11, "sys_usertable7")
if dataset11.tables("sys_usertable7").rows.count > 0 then
dim i as integer
for i = 0 to dataset11.tables("sys_usertable7").rows.count - 1
dim cataitem as new listitem()
cataitem.text = convert.tostring(dataset11.tables("sys_usertable7").rows(i).item("subject"))
cataitem.value = convert.tostring(dataset11.tables("sys_usertable7").rows(i).item("guid"))
ddl_archive.items.add(cataitem)
ddl_archive.selectedindex = -1
next
dataset11.tables("sys_usertable7").clear()
end if
catch
end try
end if
end function


'---------------------------------------------------------------------
'“查詢案卷”按鈕點擊觸發事件
'---------------------------------------------------------------------
private sub bt_archiveserch_click(byval sender as system.object, byval e as system.eventargs) handles bt_archiveserch.click
bindarchive(convert.tostring(tb_archive.text).trim, convert.tostring(lb_tablename.text).trim)
lb_archivename.visible = false
end sub


'--------------------------------------------------------------------------------------------------------------------------
'(下拉列表框)案卷改變觸發事件
'--------------------------------------------------------------------------------------------------------------------------
private sub ddl_archive_selectedindexchanged(byval sender as system.object, byval e as system.eventargs) handles ddl_archive.selectedindexchanged
lb_archivevalue.text = convert.tostring(ddl_archive().selecteditem().value()).trim
lb_archivename.visible = false
btn_reg.enabled = true
end sub


'---------------------------------------------------------------------
'改變年份下拉列表框觸發事件
'---------------------------------------------------------------------
private sub ddl_year_selectedindexchanged(byval sender as system.object, byval e as system.eventargs) handles ddl_year.selectedindexchanged
bindgrid()
end sub
end class

end namespace


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 黔江区| 阳新县| 石阡县| 宣恩县| 枣阳市| 林口县| 车险| 来安县| 夏津县| 平果县| 吴江市| 确山县| 景洪市| 绥化市| 玛多县| 通化县| 芜湖县| 山丹县| 澄迈县| 兴化市| 神农架林区| 榆树市| 武威市| 庆阳市| 蒲城县| 肃北| 当阳市| 兴业县| 元江| 祁连县| 博野县| 西畴县| 遂溪县| 休宁县| 富宁县| 东丽区| 信阳市| 平昌县| 平湖市| 峨边| 青川县|