信息管理设计

信息管理设计:

1 aspx页面

<% @ Register TagPrefix = " FTB "  Namespace = " FreeTextBoxControls "  Assembly = " FreeTextBox "   %>
<% @ Page Language = " C# "  AutoEventWireup = " true "  CodeFile = " InforManager.aspx.cs "  Inherits = " Hhxx.InterFace.InforCenter.InforManager "  ValidateRequest = " false "   %>

<! DOCTYPE html PUBLIC  " -//W3C//DTD XHTML 1.0 Transitional//EN "   " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >

< html xmlns = " http://www.w3.org/1999/xhtml "   >
< head runat = " server " >
    
< title > 信息管理 </ title >
    
< link href = " ../../css/style.css "  rel = " stylesheet "  type = " text/css "   />
</ head >
< body >
    
< form id = " formXinXiGuanli "  runat = " server " >
    
< div >
        
< asp:Menu ID = " MenuCaidan "  runat = " server "  BackColor = " #B5C7DE "  DynamicHorizontalOffset = " 2 "
            Font
- Names = " Verdana "  Font - Size = " 0.8em "  ForeColor = " #284E98 "  Orientation = " Horizontal "
            StaticSubMenuIndent
= " 10px "  OnMenuItemClick = " MenuCaidan_MenuItemClick " >
            
< StaticMenuItemStyle HorizontalPadding = " 5px "  VerticalPadding = " 2px "   />
            
< DynamicHoverStyle BackColor = " #284E98 "  ForeColor = " White "   />
            
< DynamicMenuStyle BackColor = " #B5C7DE "   />
            
< StaticSelectedStyle BackColor = " #507CD1 "   />
            
< DynamicSelectedStyle BackColor = " #507CD1 "   />
            
< DynamicMenuItemStyle HorizontalPadding = " 5px "  VerticalPadding = " 2px "   />
            
< Items >
                
< asp:MenuItem Selected = " True "  Text = " 信息栏 "  Value = " 信息栏 " ></ asp:MenuItem >
                
< asp:MenuItem Text = " 详细信息 "  Value = " 详细信息 " ></ asp:MenuItem >
                
< asp:MenuItem Text = " 添加信息 "  Value = " 添加信息 " ></ asp:MenuItem >
                
< asp:MenuItem Text = " 编辑信息 "  Value = " 编辑信息 " ></ asp:MenuItem >
                
< asp:MenuItem Text = " 查看审批结果 "  Value = " 查看审批结果 " ></ asp:MenuItem >
            
</ Items >
            
< StaticItemTemplate >
                
<% # Eval( " Text " %>
            
</ StaticItemTemplate >
            
< StaticHoverStyle BackColor = " #284E98 "  ForeColor = " White "   />
        
</ asp:Menu >
        
< table style = " border-top:0 " >< tr valign = " top " >< td style = " height: 7px " >< img height = " 5 "  src = " ../../Images/funcLine.JPG "  width = " 933 "  alt = " 图象 "   /></ td ></ tr ></ table >
    
< asp:MultiView ID = " MultiViewXinXiGuanLi "  runat = " server "  ActiveViewIndex = " 0 " >
        
< asp:View ID = " ViewXinXiLan "  runat = " server " >
        
< table >
            
< tr >
                
< td  >
                    
< table  >
                        
< tr >
                            
< td >
                                
< asp:Image ID = " ImageShouYe "  runat = " server "  ImageUrl = " ~/DatabaseImg/100.jpg "   /></ td >
                            
</ tr >
                    
</ table >
                
</ td >
                
< td  >
                    
< table >
                        
< tr >
                            
< td  > 选择类别名称
                            
</ td >
                            
< td  > 条件
                            
</ td >
                            
< td  > 输入要查询的条件值
                            
</ td >
                        
</ tr >
                        
< tr >
                            
< td  >
                                
< asp:DropDownList ID = " DropDownListLeiBeiOne "  runat = " server " ></ asp:DropDownList ></ td >
                            
< td  >
                                
< asp:DropDownList ID = " DropDownListTiaoJianOne "  runat = " server " ></ asp:DropDownList ></ td >
                            
< td  >
                                
< asp:TextBox ID = " TextBoxOne "  runat = " server "   class = " smallInput " ></ asp:TextBox ></ td >
                        
</ tr >
                        
< tr >
                            
< td  >
                                    
< asp:DropDownList ID = " DropDownListLeiBeiTwo "  runat = " server " >
                                    
</ asp:DropDownList ></ td >
                            
< td  >
                                
< asp:DropDownList ID = " DropDownListTiaoJianTwo "  runat = " server " >
                                
</ asp:DropDownList ></ td >
                            
< td  >
                                
< asp:TextBox ID = " TextBoxTwo "  runat = " server "   class = " smallInput " ></ asp:TextBox ></ td >
                        
</ tr >
                                                
< tr >
                            
< td  >
                                    
< asp:DropDownList ID = " DropDownListLeiBeiThree "  runat = " server " >
                                    
</ asp:DropDownList ></ td >
                            
< td  >
                                
< asp:DropDownList ID = " DropDownListTiaoJianThree "  runat = " server " >
                                
</ asp:DropDownList ></ td >
                            
< td  >
                                
< asp:TextBox ID = " TextBoxThree "  runat = " server "   class = " smallInput " ></ asp:TextBox ></ td >
                        
</ tr >
                                                
< tr >
                            
< td  >
                                    
< asp:DropDownList ID = " DropDownListLeiBeiFour "  runat = " server " >
                                    
</ asp:DropDownList ></ td >
                            
< td  >
                                
< asp:DropDownList ID = " DropDownListTiaoJianFour "  runat = " server " >
                                
</ asp:DropDownList ></ td >
                            
< td  >
                                
< asp:TextBox ID = " TextBoxFour "  runat = " server "   class = " smallInput " ></ asp:TextBox ></ td >
                        
</ tr >
                                                
< tr >
                            
< td  >
                                
< font color = " blue " >
                                    
< asp:Label ID = " Labelchaxunfangshi "  runat = " server "  Text = " 查询排序方式: " ></ asp:Label ></ font ></ td >
                            
< td  >
                                
< asp:DropDownList ID = " DropDownListPaiXuFangShi "  runat = " server "  BackColor = " Transparent "  ForeColor = " Blue " >
                                
</ asp:DropDownList ></ td >
                            
< td  >
                                
</ td >
                        
</ tr >
                    
</ table >
                
</ td >
                
< td style = " height: 176px " >< table >< tr >< td >
                    
< asp:Button ID = " ButtonTiJianChaXun "  runat = " server "  Text = " 条件查询 "   class = " buttonface "  OnClick = " ButtonTiJianChaXun_Click "   /></ td ></ tr ></ table ></ td >
                
</ tr >       
        
</ table >
                
< img height = " 5 "  src = " ../../Images/funcLine.JPG "  width = " 933 "  alt = " 图象 "   />< br  />
                
< asp:Button ID = " ButtonTianJia "  runat = " server "  Text = " 添加 "    class = " buttonface "  OnClick = " ButtonTianJia_Click "   />
                
< asp:Button ID = " ButtonBianJi "  runat = " server "  Text = " 编辑 "    class = " buttonface "  OnClick = " ButtonBianJi_Click "   />
                
< asp:Button ID = " ButtonShanChu "  runat = " server "  Text = " 删除 "   class = " buttonface "  OnClick = " ButtonShanChu_Click "   OnClientClick = " return confirm('确认要删除吗?'); "   />
                
< asp:Button ID = " ButtonChaYue "  runat = " server "  Text = " 查阅 "    class = " buttonface "  OnClick = " ButtonChaYue_Click "   />
            
< asp:Button ID = " ButtonShenPiYiJian "  runat = " server "  OnClick = " ButtonShenPiYiJian_Click "   class = " buttonface "  Text = " 查看审批结果 "   />< br  />
                
< asp:GridView ID = " GridViewXinXiLan "  runat = " server "  CellPadding = " 4 "  ForeColor = " #333333 "  GridLines = " None "  DataKeyNames = " SN "  AllowPaging = " True "  OnPageIndexChanging = " GridViewXinXiLan_PageIndexChanging "  OnRowCreated = " GridViewXinXiLan_RowCreated " >
                    
< FooterStyle BackColor = " #507CD1 "  Font - Bold = " True "  ForeColor = " White "  Font - Size = " Small "   />
                    
< RowStyle BackColor = " #EFF3FB "   />
                    
< EditRowStyle BackColor = " #2461BF "   />
                    
< SelectedRowStyle BackColor = " DodgerBlue "  Font - Bold = " False "  ForeColor = " #333333 "   />
                    
< PagerStyle BackColor = " #2461BF "  ForeColor = " White "  HorizontalAlign = " Center "   />
                    
< HeaderStyle BackColor = " #507CD1 "  Font - Bold = " True "  ForeColor = " White "  Font - Size = " 10pt "   />
                    
< AlternatingRowStyle BackColor = " White "   />
                    
< Columns >
                        
< asp:TemplateField >
                            
< EditItemTemplate >
                                
< asp:CheckBox ID = " CheckBox1 "  runat = " server "   />
                            
</ EditItemTemplate >
                            
< ItemTemplate >
                                
< asp:CheckBox ID = " CheckBoxFuXuan "  runat = " server "   />
                            
</ ItemTemplate >
                        
</ asp:TemplateField >
                        
< asp:TemplateField HeaderText = " 选择 "  ShowHeader = " False " >
                            
< ItemTemplate >
                                
< asp:LinkButton ID = " LinkButton1 "  runat = " server "  CausesValidation = " False "  CommandName = " Select "
                                    Text
= " 选择 " ></ asp:LinkButton >
                            
</ ItemTemplate >
                        
</ asp:TemplateField >
                    
</ Columns >
                    
< PagerSettings Visible = " False "   />
                
</ asp:GridView >
            
< table >
                
< tr >
                    
< td >
                    
< asp:LinkButton ID = " lnkbtnFirst "  runat = " server "  OnClick = " PagerButtonClick " > 首页 </ asp:LinkButton >< asp:LinkButton ID = " lnkbtnPre "  runat = " server "  OnClick = " PagerButtonClick " > 上一页 </ asp:LinkButton >
                    
< asp:LinkButton ID = " lnkbtnNext "  runat = " server "  OnClick = " PagerButtonClick " > 下一页 </ asp:LinkButton >
                    
< asp:LinkButton ID = " lnkbtnLast "  runat = " server "  OnClick = " PagerButtonClick " > 尾页 </ asp:LinkButton >
                    
< asp:Label ID = " lblCurrentIndex "  runat = " server "  Text = " 第?页 " ></ asp:Label >
                    
< asp:Label ID = " lblPageCount "  runat = " server "  Text = " 共?页 " ></ asp:Label >
                    
< asp:Label ID = " lblRecordCount "  runat = " server "  Text = " 记录数 " ></ asp:Label >
                    
< asp:TextBox ID = " txtJumpPage "  runat = " server "  Width = " 24px " > 1 </ asp:TextBox >
                    
< asp:LinkButton ID = " lnkbtnJumpPage "  runat = " server "  OnClick = " lnkbtnJumpPage_Click " > 跳转 </ asp:LinkButton >< br  />
                    
</ td >
                
</ tr >
            
</ table >

            
</ asp:View >
            
< asp:View ID = " ViewXiangXiXinXi "  runat = " server " >
                
< table  >
                    
< tr >
                        
< td valign = " top " >
                            
< asp:Image ID = " ImageXiangXi "  runat = " server "  ImageUrl = " ~/DatabaseImg/he.jpg "   /></ td >
                        
< td  >
                            
< table >
                                
< tr >
                                    
< td >
                                        
< asp:Label ID = " LabelJianLiRiQi "  runat = " server "  Text = " 建立日期 " ></ asp:Label ></ td >
                                    
< td style = " width: 553px " >
                                        
< asp:TextBox ID = " TextBoxJianLiRiQi "  value = ""  runat = " server "   class = " smallInput " ></ asp:TextBox ></ td >
                                
</ tr >
                                
< tr >
                                    
< td >
                                        
< asp:Label ID = " LabelXinXiBiaoTi "  runat = " server "  Text = " 信息标题 " ></ asp:Label ></ td >
                                    
< td >
                                        
< asp:TextBox ID = " TextBoxXinXiBiaoTi "  runat = " server "   class = " smallInput "   ></ asp:TextBox >
                                        
< asp:Label ID = " LabelStarBiaoTi "  runat = " server "  BackColor = " Transparent "  BorderColor = " Transparent "
                                            ForeColor
= " Red "  Text = " * " ></ asp:Label ></ td >
                                
</ tr >
                                
< tr >
                                    
< td >
                                        
< asp:Label ID = " LabelFaBuBUMen "  runat = " server "  Text = " 发布部门 " ></ asp:Label ></ td >
                                    
< td >
                                        
< asp:TextBox ID = " TextBoxFaBuBuMen "  runat = " server "   class = " smallInput "  value = ""  Width = " 200px " ></ asp:TextBox >
                                        
< asp:Button ID = " ButtonTianFaBuBuMen "  runat = " server "  Text = " 选择部门... "  OnClick = " ButtonTianFaBuBuMen_Click "   /></ td >
                                 
</ tr >
                                 
< tr >
                                    
< td >
                                        
< asp:Label ID = " LabelJinBanRen "  runat = " server "  Text = " 经办人 " ></ asp:Label ></ td >
                                    
< td >
                                        
< asp:TextBox ID = " TextBoxJinBanRen "  runat = " server "   class = " smallInput " ></ asp:TextBox ></ td >
                                 
</ tr >
                                 
< tr >
                                    
< td >
                                        
< asp:Label ID = " LabelXinXiLeiXing "  runat = " server "  Text = " 信息类型 " ></ asp:Label ></ td >
                                    
< td >
                                        
< asp:DropDownList ID = " DropDownListXinXiLeiXing "  runat = " server "   class = " smallInput " >
                                        
</ asp:DropDownList ></ td >
                                 
</ tr >
                                 
< tr  >
                                    
< td valign = " top " >
                                        
< asp:Label ID = " LabelXinXiNeiRong "  runat = " server "  Text = " 信息内容  " ></ asp:Label ></ td >
                                    
< td >
                                        
< FTB:FreeTextBox id = " FreeTextBoxXinXiNeiRong "  runat = " Server "  AllowHtmlMode = " True "  ButtonFileExtention = " gif,jpg,*.* "  ImageGalleryPath = " ~/imagesLib/ "  ToolbarLayout = " ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu|Bold,Italic,Underline,Strikethrough;Superscript,Subscript,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage,InsertRule,InsertImageFromGallery|Cut,Copy,Paste;Undo,Redo,Print "  Height = " 400px "  Width = " 550px "  Language = " zh-CN "   />
                                        
< asp:Label ID = " LabelStarNeiRong "  runat = " server "  BackColor = " Transparent "  BorderColor = " Transparent "
                                            ForeColor
= " Red "  Text = " * " ></ asp:Label ></ td >
                                 
</ tr >
                                 
< tr >
                                    
< td >
                                        
< asp:Label ID = " LabelGuanJianZi "  runat = " server "  Text = " 关键字 " ></ asp:Label >
                                    
</ td >
                                    
< td  >
                                        
< asp:TextBox ID = " TextBoxGuanJianZi "  runat = " server "   class = " smallInput " ></ asp:TextBox >
                                        
< asp:Label ID = " LabelStarGuanJianZi "  runat = " server "  BackColor = " Transparent "  BorderColor = " Transparent "
                                            ForeColor
= " Red "  Text = " * " ></ asp:Label ></ td >
                                 
</ tr >
                                 
< tr >
                                    
< td >
                                        
< asp:Label ID = " LabelYueDuCiShu "  runat = " server "  Text = " 阅读次数 " ></ asp:Label ></ td >
                                    
< td >
                                        
< asp:TextBox ID = " TextBoxYueDuCiShu "  runat = " server "   class = " smallInput " ></ asp:TextBox ></ td >
                                 
</ tr >
                                 
< tr >
                                    
< td >
                                        
< asp:Label ID = " LabelShenPiRen "  runat = " server "  Text = " 审批人 " ></ asp:Label ></ td >
                                    
< td >
                                        
< asp:TextBox ID = " TextBoxShenPiRen "  runat = " server "   class = " smallInput " ></ asp:TextBox >
                                        
< asp:Label ID = " LabelStarShenPiRen "  runat = " server "  BackColor = " Transparent "  BorderColor = " Transparent "
                                            ForeColor
= " Red "  Text = " * " ></ asp:Label ></ td >
                                 
</ tr >
                                 
< tr >
                                    
< td >
                                        
< asp:Label ID = " LabelQuanXianRenYuan "  runat = " server "  Text = " 权限人员 " ></ asp:Label ></ td >
                                    
< td >
                                        
< asp:TextBox ID = " TextBoxQuanXianRenYuan "  runat = " server "   class = " smallInput "  Width = " 400px " ></ asp:TextBox >< asp:Button ID = " ButtonTianXuanZeQuanXian "  runat = " server "  OnClick = " ButtonTianXuanZeQuanXian_Click "
                                            Text
= " 选择部门或人员... "   /></ td >
                                 
</ tr >
                                 
< tr >
                                    
< td >
                                        
< asp:Label ID = " LabelShenPiJieGuo "  runat = " server "  Text = " 审批结果 " ></ asp:Label ></ td >
                                    
< td >
                                        
< asp:TextBox ID = " TextBoxShenPiJieGuo "  runat = " server "   class = " smallInput " ></ asp:TextBox ></ td >
                                 
</ tr >
                                 
< tr >
                                    
< td valign = " top " >
                                        
< asp:Label ID = " LabelShenPiYiJian "  runat = " server "  Text = " 审批意见 " ></ asp:Label ></ td >
                                    
< td >< FTB:FreeTextBox id = " FreeTextBoxShenPiYiJian "  runat = " Server "  AllowHtmlMode = " True "  ButtonFileExtention = " gif,jpg,*.* "  ImageGalleryPath = " ~/imagesLib/ "  ToolbarLayout = " ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu|Bold,Italic,Underline,Strikethrough;Superscript,Subscript,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage,InsertRule,InsertImageFromGallery|Cut,Copy,Paste;Undo,Redo,Print "  Height = " 400px "  Width = " 550px "  Language = " zh-CN "  Visible = " False "   /></ td >
                                 
</ tr >
                            
</ table >
                        
</ td >
                    
</ tr >
                    
< tr >
                    
< td ></ td >
                        
< td align = " center " >
                        
< asp:Button ID = " ButtonCaoZuo "  runat = " server "  Text = " 操作类型 "  OnClick = " ButtonCaoZuo_Click "   />
                        
</ td >
                    
</ tr >
                
</ table >
            
</ asp:View >
        
</ asp:MultiView >
    
</ div >
    
</ form >
</ body >
</ html >

2 cs页面

/*----------------------------------------------------------------
// Copyright (C) 2007 桂林电子科技大学昊华南方项目组
// 作者:马如林
// 时间:2007/05/11
// 文件名:
// 文件功能描述:
//                  信息管理页面
//                  
// 
// 修改标识:
// 修改描述:
// 
//----------------------------------------------------------------
*/


using  System;
using  System.Data;
using  System.Configuration;
using  System.Collections;
using  System.Web;
using  System.Web.Security;
using  System.Web.UI;
using  System.Web.UI.WebControls;
using  System.Web.UI.WebControls.WebParts;
using  System.Web.UI.HtmlControls;

using  System.Globalization;
using  System.Data.OracleClient;
using  System.IO;
using  System.Text;

using  Hhxx.App_Code.DatabaseOperate;
using  Hhxx.App_Code.Database;
using  Hhxx.App_Code.Common;

using  Hhxx.InterFace.InforCenter;

namespace  Hhxx.InterFace.InforCenter
{
    
public partial class InforManager : System.Web.UI.Page
    
{
        
// 信息表
        private const string XIN_XI = "xinxi";
        
// SN
        private const string SN = "SN";
        
// 主键的全局变量
        private String primaryKey = null;

        
protected void Page_Load(object sender, EventArgs e)
        
{
            
this.MenuCaidan.Items[0].Enabled = true;
            
this.MenuCaidan.Items[1].Enabled = false;
            
this.MenuCaidan.Items[2].Enabled = false;
            
this.MenuCaidan.Items[3].Enabled = false;
            
this.MenuCaidan.Items[4].Enabled = false;

            
if (!Page.IsPostBack)
            
{
                dropDownListInit();
                
// 初始化默认Gridview的SQL语句
                String querySql = "SELECT 建立日期,信息标题,发布部门,经办人,信息类型,关键字,阅读次数,审批结果,SN FROM " + XIN_XI + " WHERE ROWNUM<11";

                fillGridView(querySql);
            }


        }


        
/// <summary>
        
/// 选择Tab栏目
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void MenuCaidan_MenuItemClick(object sender, MenuEventArgs e)
        
{
            
switch (MenuCaidan.SelectedItem.Text.Trim())
            
{
                
case "信息栏":
                    
{
                        MultiViewXinXiGuanLi.ActiveViewIndex 
= 0;
                        String querySql 
= "SELECT 建立日期,信息标题,发布部门,经办人,信息类型,关键字,阅读次数,审批结果,SN FROM " + XIN_XI + " WHERE ROWNUM<11";
                        fillGridView(querySql);
                        
break;
                    }


                
case "详细信息": MultiViewXinXiGuanLi.ActiveViewIndex = 1;
                    
break;

                
case "添加信息": MultiViewXinXiGuanLi.ActiveViewIndex = 1;
                    
break;

                
case "查看信息": MultiViewXinXiGuanLi.ActiveViewIndex = 1;
                    
break;

                
defaultbreak;
            }

        }


        
/// <summary>
        
/// 初始化DropDownList
        
/// </summary>

        private void dropDownListInit()
        
{

            GetTableInformation getTableInformation 
= new GetTableInformation();

            
// 获取表结构信息
            Hashtable tableInfor = getTableInformation.getTableInfor(XIN_XI);

            
// 移除SN
            tableInfor.Remove(SN);

            
foreach (DictionaryEntry de in tableInfor)
            
{
                String key 
= de.Key.ToString();
                String value 
= de.Value.ToString();

                
// 排序方式下拉框添加数据字段
                DropDownListPaiXuFangShi.Items.Add(key);

                
switch (value)
                
{
                    
case "CHAR":
                        DropDownListLeiBeiOne.Items.Add(key);
                        DropDownListLeiBeiTwo.Items.Add(key);
                        
break;

                    
case "VARCHAR2":
                        DropDownListLeiBeiOne.Items.Add(key);
                        DropDownListLeiBeiTwo.Items.Add(key);
                        
break;

                    
case "NUMBER":
                        DropDownListLeiBeiThree.Items.Add(key);
                        DropDownListLeiBeiFour.Items.Add(key);
                        
break;
                }


            }


            DropDownListTiaoJianOne.Items.Add(
"包含");
            DropDownListTiaoJianOne.Items.Add(
"不包含");

            DropDownListTiaoJianTwo.Items.Add(
"包含");
            DropDownListTiaoJianTwo.Items.Add(
"不包含");

            DropDownListTiaoJianThree.Items.Add(
"等于");
            DropDownListTiaoJianThree.Items.Add(
"小于");
            DropDownListTiaoJianThree.Items.Add(
"大于");

            DropDownListTiaoJianFour.Items.Add(
"等于");
            DropDownListTiaoJianFour.Items.Add(
"小于");
            DropDownListTiaoJianFour.Items.Add(
"大于");

            
if (DropDownListLeiBeiOne.Items.Count == 0)
            
{
                
this.DropDownListLeiBeiOne.Visible = false;
                
this.DropDownListTiaoJianOne.Visible = false;
                
this.TextBoxOne.Visible = false;

            }


            
if (DropDownListLeiBeiTwo.Items.Count == 0)
            
{
                
this.DropDownListLeiBeiTwo.Visible = false;
                
this.DropDownListTiaoJianTwo.Visible = false;
                
this.TextBoxTwo.Visible = false;

            }


            
if (DropDownListLeiBeiThree.Items.Count == 0)
            
{
                
this.DropDownListLeiBeiThree.Visible = false;
                
this.DropDownListTiaoJianThree.Visible = false;
                
this.TextBoxThree.Visible = false;
            }


            
if (DropDownListLeiBeiFour.Items.Count == 0)
            
{
                
this.DropDownListLeiBeiFour.Visible = false;
                
this.DropDownListTiaoJianFour.Visible = false;
                
this.TextBoxFour.Visible = false;

            }


        }


        
/// <summary>
        
/// 填充GridView
        
/// </summary>

        private void fillGridView(String querySql)
        
{
            DataSet ds 
= new DataSet();
            ds 
= GetData(querySql);

            
// 清空以前的数据源
            GridViewXinXiLan.DataSource = null;

            
// 将ds作为信息栏GridView的数据源
            GridViewXinXiLan.DataSource = ds;

            
// 绑定数据
            GridViewXinXiLan.DataBind();

            
// 分页的相关参数设置
            getRefSet(ds);

            
// 保存数据源 防止丢失 VS的破Bug
            ViewState["GridViewXinXiLan_DataSource"= GridViewXinXiLan.DataSource;
            
// 保存SQL语句
            ViewState["sql"= querySql;
        }


        
/// <summary>
        
/// 转换SQL查询结果为DataSet
        
/// </summary>
        
/// <returns>ds</returns>

        private DataSet GetData(String querySql)
        
{
            String connStr 
= OracleHelper.DatabaseConnStr;

            
// 创建数据集
            DataSet ds = OracleHelper.ExeSqlForDataSet(connStr, CommandType.Text, querySql, null);

            
return ds;
        }


        
/// <summary>
        
/// 添加
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void ButtonTianJia_Click(object sender, EventArgs e)
        
{
            
this.MenuCaidan.Items[2].Enabled = true;
            MenuCaidan.Items[
2].Selected = true;
            MultiViewXinXiGuanLi.ActiveViewIndex 
= 1;
            
this.ButtonCaoZuo.Text = "添加信息";
            
// 格式化日期函数
            this.TextBoxJianLiRiQi.Text = DateTime.Now.ToString("yyyy-MM-dd",DateTimeFormatInfo.InvariantInfo);
            TextBoxJianLiRiQi.Enabled 
= false;

            
this.LabelStarBiaoTi.Visible = true;
            
this.LabelStarGuanJianZi.Visible = true;
            
this.LabelStarNeiRong.Visible = true;
            
this.LabelStarShenPiRen.Visible = true;

            
this.TextBoxXinXiBiaoTi.Text = "";
            
this.TextBoxFaBuBuMen.Text = "";

            
this.FreeTextBoxXinXiNeiRong.Text = "";
            
this.TextBoxGuanJianZi.Text = "";
            
this.TextBoxShenPiRen.Text = "";
            
this.TextBoxQuanXianRenYuan.Text = "";

            
this.TextBoxQuanXianRenYuan.Visible = true;

            
this.LabelQuanXianRenYuan.Visible = true;
            
this.LabelShenPiRen.Visible = true;

            
this.TextBoxShenPiRen.Visible = true;
            
this.TextBoxShenPiRen.Enabled = true;

            
this.ButtonTianFaBuBuMen.Visible = true;
            
this.ButtonTianFaBuBuMen.Enabled = true;

            
this.ButtonTianXuanZeQuanXian.Enabled = true;
            
this.ButtonTianXuanZeQuanXian.Visible = true;

            
this.LabelYueDuCiShu.Visible = false;
            
this.TextBoxYueDuCiShu.Visible = false;
            
this.TextBoxYueDuCiShu.Enabled = false;

            
this.LabelShenPiJieGuo.Visible = false;
            
this.TextBoxShenPiJieGuo.Visible = false;
            
this.TextBoxShenPiJieGuo.Enabled = false;

            
this.LabelShenPiYiJian.Visible = false;
            
this.FreeTextBoxShenPiYiJian.Visible = false;

            
this.ButtonCaoZuo.Visible = true;
            
this.ButtonCaoZuo.Enabled = true;
            
this.ButtonCaoZuo.Text = "添加信息";

            
// 初始化下拉列表
            this.DropDownListXinXiLeiXing.Items.Clear();
            String conn 
= OracleHelper.DatabaseConnStr;
            
// 读取信息类别列表
            String querySql = "SELECT 名称 FROM XITONGZIDIAN WHERE ID='01010002' ORDER BY 序号";
            OracleDataReader dataReader 
= OracleHelper.ExecuteReader(conn, CommandType.Text, querySql, null);
            
while (dataReader.Read())
            
{
                
this.DropDownListXinXiLeiXing.Items.Add(dataReader.GetString(0));
            }

            dataReader.Close();

        }


        
/// <summary>
        
/// 验证项是否正确输入
        
/// </summary>
        
/// <returns></returns>

        private Boolean  validTerm()
        
{
            
if (this.TextBoxXinXiBiaoTi.Text.Length == 0)
            
{
                
// 错误信息提示
                String tip = "信息标题不可为空";
                Response.Write(
"<script>alert('" + tip + "')</script>");
                
return false;
            }

            
else if (this.TextBoxFaBuBuMen.Text.Length == 0)
            
{
                
// 错误信息提示
                String tip = "发布部门不可为空";
                Response.Write(
"<script>alert('" + tip + "')</script>");
                
return false;
            }

            
else if (this.FreeTextBoxXinXiNeiRong.Text.Length == 0)
            
{
                
// 错误信息提示
                String tip = "信息内容不可为空";
                Response.Write(
"<script>alert('" + tip + "')</script>");
                
return false;
            }

            
else if (this.TextBoxGuanJianZi.Text.Length == 0)
            
{
                
// 错误信息提示
                String tip = "关键字不可为空";
                Response.Write(
"<script>alert('" + tip + "')</script>");
                
return false;
            }

            
else if (this.TextBoxShenPiRen.Text.Length == 0)
            
{
                
// 错误信息提示
                String tip = "审批人不可为空";
                Response.Write(
"<script>alert('" + tip + "')</script>");
                
return false;
            }

            
else if (this.TextBoxQuanXianRenYuan.Text.Length == 0)
            
{
                
// 错误信息提示
                String tip = "权限人员不可为空";
                Response.Write(
"<script>alert('" + tip + "')</script>");
                
return false;
            }


            
return true;
        }

        
/// <summary>
        
/// 添加信息按钮点击 添加信息入数据库
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void AddInformation()
        
{
            
if (validTerm())
            
{
                
// 生成GUID 
                String SN = System.Guid.NewGuid().ToString().Replace("-""");

                
//有事务处理 SN的生成
                String sqlInsert = "INSERT INTO xinxi(建立日期,信息标题,发布部门,经办人,信息类型,信息内容,关键字,阅读次数,审批人,SN) VALUES(:jlrq,:xxbt,:fbbm,:jbr,:xxlx,:xxnr,:gjz,:ydcs,:spr,:sn)";

                OracleParameter[] parms 
= {
                
new OracleParameter(":jlrq", OracleType.Char, 10),
                
new OracleParameter(":xxbt", OracleType.VarChar, 255),
                
new OracleParameter(":fbbm", OracleType.Char, 64),
                
new OracleParameter(":jbr", OracleType.Char, 20),
                
new OracleParameter(":xxlx", OracleType.Char, 8),
                
new OracleParameter(":xxnr", OracleType.Clob),
                
new OracleParameter(":gjz", OracleType.Char, 128),
                
new OracleParameter(":ydcs", OracleType.Number, 10),
                
new OracleParameter(":spr", OracleType.Char, 20),
                
new OracleParameter(":sn", OracleType.Char, 32)
                }
;

                parms[
0].Value = this.TextBoxJianLiRiQi.Text.Trim();
                parms[
1].Value = this.TextBoxXinXiBiaoTi.Text.Trim();
                parms[
2].Value = this.TextBoxFaBuBuMen.Text.Trim();
                parms[
3].Value = this.TextBoxJinBanRen.Text.Trim();
                parms[
4].Value = this.DropDownListXinXiLeiXing.SelectedItem.Text.Trim();
                parms[
5].Value = this.FreeTextBoxXinXiNeiRong.Text;
                parms[
6].Value = this.TextBoxGuanJianZi.Text.Trim();
                parms[
7].Value = 0;
                parms[
8].Value = this.TextBoxShenPiRen.Text.Trim();
                parms[
9].Value = SN;


                
// 信息权限子表
                String sqlChildTableInsert = "INSERT INTO xinxiquanxian(ID,权限人员,SN) VALUES(:ID,:qxry,:xxqxSN)";
                OracleParameter[] parmsQuanXian 
= {
                
new OracleParameter(":ID", OracleType.Char, 32),
                
new OracleParameter(":qxry", OracleType.VarChar, 1024),
                
new OracleParameter(":xxqxSN", OracleType.Char, 32)
                }
;

                parmsQuanXian[
0].Value = SN;
                parmsQuanXian[
1].Value = this.TextBoxQuanXianRenYuan.Text.Trim();
                parmsQuanXian[
2].Value = System.Guid.NewGuid().ToString().Replace("-""");


                
// 信息审批子表
                String sqlXxspInsert = "INSERT INTO xinxishenpi(ID,审批人,SN) VALUES(:id,:spr,:sn)";
                OracleParameter[] parmsShenPi 
= {
                
new OracleParameter(":id", OracleType.Char, 32),
                
new OracleParameter(":spr", OracleType.Char, 20),
                
new OracleParameter(":sn", OracleType.Char, 32)
                }
;

                parmsShenPi[
0].Value = SN;
                parmsShenPi[
1].Value = this.TextBoxShenPiRen.Text.Trim();
                parmsShenPi[
2].Value = System.Guid.NewGuid().ToString().Replace("-"""); ;


                OracleConnection conn 
= new OracleConnection(OracleHelper.DatabaseConnStr);
                conn.Open();
                OracleTransaction trans 
= conn.BeginTransaction(IsolationLevel.ReadCommitted);

                
try
                
{
                    OracleHelper.ExecuteNonQuery(trans, CommandType.Text, sqlInsert, parms);
                    OracleHelper.ExecuteNonQuery(trans, CommandType.Text, sqlChildTableInsert, parmsQuanXian);
                    OracleHelper.ExecuteNonQuery(trans, CommandType.Text, sqlXxspInsert, parmsShenPi);
                    trans.Commit();
                }

                
catch (Exception ex)
                
{
                    trans.Rollback();
                    ex.ToString();
                }

                
finally
                
{
                    conn.Close();
                }

            }


        }


        
/// <summary>
        
/// 打开选择部门或人员的新窗体
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void ButtonTianXuanZeQuanXian_Click(object sender, EventArgs e)
        
{
            
// 打开新窗体 选择人员和部门列表
            Response.Write("<script>window.open('/Hhxx/Common/DepartPeople.aspx','_Blank','Height=250px,Width=260px,top=250,left=350');</script>");
        }


        
/// <summary>
        
/// 选择发布部门
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void ButtonTianFaBuBuMen_Click(object sender, EventArgs e)
        
{
            Response.Write(
"<script>window.open('/Hhxx/Common/Departments.aspx','_Blank','Height=250px,Width=260px,top=250,left=350');</script>");
        }


        
/// <summary>
        
/// 条件查询
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void ButtonTiJianChaXun_Click(object sender, EventArgs e)
        
{
            String strSql 
= "SELECT 建立日期,信息标题,发布部门,经办人,信息类型,关键字,阅读次数,审批结果,SN FROM xinxi";
            String strCondition 
= "";
            String strChoose 
= "";
            
            
if (TextBoxOne.Text.Trim().Length != 0)
            
{
                String tempStr 
= DropDownListTiaoJianOne.SelectedItem.Value;
                
switch (tempStr)
                
{
                    
case "包含": strChoose = " LIKE ";
                        
break;
                    
case "不包含": strChoose = " NOT LIKE ";
                        
break;
                }

                
                
if (strCondition.Length == 0)
                
{
                    strCondition 
= strCondition + DropDownListLeiBeiOne.SelectedItem.Value + strChoose + "'%" + TextBoxOne.Text.Trim() + "%'";
                }

                
else
                
{
                    strCondition 
= strCondition + "AND " + DropDownListLeiBeiOne.SelectedItem.Value + strChoose + "'%" + TextBoxOne.Text.Trim() + "%'";
                }

            }


            
if (TextBoxTwo.Text.Trim().Length != 0)
            
{
                String tempStr 
= DropDownListTiaoJianTwo.SelectedItem.Value;
                
switch (tempStr)
                
{
                    
case "包含": strChoose = " LIKE ";
                        
break;
                    
case "不包含": strChoose = " NOT LIKE ";
                        
break;
                }


                
if (strCondition.Length == 0)
                
{
                    strCondition 
= strCondition + DropDownListLeiBeiTwo.SelectedItem.Value + strChoose + "'%" + TextBoxTwo.Text.Trim() + "%'";
                }

                
else
                
{
                    strCondition 
= strCondition + "AND " + DropDownListLeiBeiTwo.SelectedItem.Value + strChoose + "'%" + TextBoxTwo.Text.Trim() + "%'";
                }

            }


            
if (TextBoxThree.Text.Trim().Length != 0)
            
{
                String tempStr 
= DropDownListTiaoJianThree.SelectedItem.Value;
                
switch (tempStr)
                
{
                    
case "等于": strChoose = "=";
                        
break;
                    
case "大于": strChoose = ">";
                        
break;
                    
case "小于": strChoose = "<";
                        
break;
                }


                
if (strCondition.Length == 0)
                
{
                    strCondition 
= strCondition + DropDownListLeiBeiThree.SelectedItem.Value + strChoose + TextBoxThree.Text.Trim();
                }

                
else
                
{
                    strCondition 
= strCondition + "AND " + DropDownListLeiBeiThree.SelectedItem.Value + strChoose + TextBoxThree.Text.Trim();
                }

            }


            
if (TextBoxFour.Text.Trim().Length != 0)
            
{
                String tempStr 
= DropDownListTiaoJianFour.SelectedItem.Value;
                
switch (tempStr)
                
{
                    
case "等于": strChoose = "=";
                        
break;
                    
case "大于": strChoose = ">";
                        
break;
                    
case "小于": strChoose = "<";
                        
break;
                }

                
if (strCondition.Length == 0)
                
{
                    strCondition 
= strCondition + DropDownListLeiBeiFour.SelectedItem.Value + strChoose + TextBoxFour.Text.Trim();
                }

                
else
                
{
                    strCondition 
= strCondition + "AND " + DropDownListLeiBeiFour.SelectedItem.Value + strChoose + TextBoxFour.Text.Trim();
                }

            }


            
if (strCondition.Length != 0)
            
{
                strCondition 
= " where " + strCondition;
            }


            strCondition 
= strCondition + " ORDER BY " + DropDownListPaiXuFangShi.SelectedItem.Value.Trim();
            strSql 
= strSql + strCondition;
            String querySql 
= strSql;
            
// 填充表格
            fillGridView(querySql);
            
// 保存SQL语句
            ViewState["sql"= querySql;
        }


        
/// <summary>
        
/// 编辑信息
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void EditInformation()
        
{
            
// 主键
            primaryKey = this.GridViewXinXiLan.DataKeys[this.GridViewXinXiLan.SelectedRow.RowIndex][0].ToString();
            
// 标题
            this.TextBoxXinXiBiaoTi.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[3].Text.ToString();
            
// 建立日期
            this.TextBoxJianLiRiQi.ReadOnly = true;
            
this.TextBoxJianLiRiQi.BackColor = System.Drawing.Color.FromArgb(224224224);
            
this.TextBoxJianLiRiQi.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[2].Text.ToString();
            
// 发布部门
            this.TextBoxFaBuBuMen.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[4].Text.ToString();
            
// 经办人
            this.TextBoxJinBanRen.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[5].Text.ToString();
            
this.TextBoxJinBanRen.ReadOnly = true;
            
this.TextBoxJinBanRen.BackColor = System.Drawing.Color.FromArgb(224224224);
            
// 信息类型
            this.DropDownListXinXiLeiXing.Items.Remove(this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[6].Text.ToString().Trim());
            
this.DropDownListXinXiLeiXing.Items.Insert(0this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[6].Text.ToString().Trim());
            
// 信息内容
            int actual = 0;
            String conn 
= OracleHelper.DatabaseConnStr;
            String getConent 
= "SELECT 信息内容,审批人 FROM xinxi WHERE SN =" + "'" + primaryKey + "'";
            OracleDataReader dr 
= OracleHelper.ExecuteReader(conn, CommandType.Text, getConent, null);
            
while (dr.Read())
            
{
                OracleLob myOracleClob 
= dr.GetOracleLob(0);

                StreamReader streamreader 
= new StreamReader(myOracleClob, Encoding.Unicode);
                
char[] cbuffer = new char[1000000];
                
while ((actual = streamreader.Read(cbuffer, 0, cbuffer.Length)) > 0)
                
{
                    String content 
= new string(cbuffer, 0, actual);
                    
this.FreeTextBoxXinXiNeiRong.Text = content;
                }

                
// 审批人 
                this.TextBoxShenPiRen.Text = dr.GetString(1);
            }

            dr.Close();

            
// 获取权限人员 
            String getRights = "SELECT 权限人员 FROM xinxiquanxian WHERE ID = " + "'" + primaryKey + "'";
            OracleDataReader rd 
= OracleHelper.ExecuteReader(conn, CommandType.Text, getRights, null);
            
while (rd.Read())
            
{
                
// 审批人 
                this.TextBoxQuanXianRenYuan.Text = rd.GetString(0);
            }

            rd.Close();

            
// 关键字
            this.TextBoxGuanJianZi.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[7].Text.ToString();
            
// 阅读次数
            this.TextBoxYueDuCiShu.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[8].Text.ToString();

        }


        
/// <summary>
        
/// 解决没有数据源不能分页的问题
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void GridViewXinXiLan_PageIndexChanging(object sender, GridViewPageEventArgs e)
        
{
            
// 读取数据源 设定显示值 并绑定
            GridViewXinXiLan.DataSource = ViewState["GridViewXinXiLan_DataSource"];
            GridViewXinXiLan.PageIndex 
= e.NewPageIndex;
            GridViewXinXiLan.DataBind();
        }


        
/// <summary>
        
/// 更新信息
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void UpdateInformation()
        
{

            
//有事务处理 SN的生成
            String sqlUpdate = "UPDATE xinxi SET 信息标题=:xxbt, 发布部门=:fbbm, 信息类型=:xxlx, 信息内容=:xxnr, 关键字=:gjz, 审批人=:spr, 更新时间=:gxsj WHERE SN=:sn ";

            OracleParameter[] parms 
= {
            
new OracleParameter(":xxbt", OracleType.VarChar, 255), 
            
new OracleParameter(":fbbm", OracleType.Char, 64),
            
new OracleParameter(":xxlx", OracleType.Char, 8),
            
new OracleParameter(":xxnr", OracleType.Clob),
            
new OracleParameter(":gjz", OracleType.Char, 128),
            
new OracleParameter(":spr", OracleType.Char, 128),
            
new OracleParameter(":gxsj", OracleType.Char, 128),
            
new OracleParameter(":sn", OracleType.Char, 32),
            }
;

            parms[
0].Value = this.TextBoxXinXiBiaoTi.Text.Trim();
            parms[
1].Value = this.TextBoxFaBuBuMen.Text.Trim();
            parms[
2].Value = this.DropDownListXinXiLeiXing.SelectedItem.Text.Trim();
            parms[
3].Value = this.FreeTextBoxXinXiNeiRong.Text;
            parms[
4].Value = this.TextBoxGuanJianZi.Text.Trim();
            parms[
5].Value = this.TextBoxShenPiRen.Text.Trim();
            parms[
6].Value = DateTime.Now.ToString("yyyy-MM-dd", DateTimeFormatInfo.InvariantInfo) + " " + DateTime.Now.ToString("HH:mm:ss", DateTimeFormatInfo.InvariantInfo);
            parms[
7].Value = this.GridViewXinXiLan.DataKeys[this.GridViewXinXiLan.SelectedRow.RowIndex][1].ToString().Trim(); 

            
// 信息权限子表 不可以写成ID=:ID
            String sqlChildUpdate = "UPDATE xinxiquanxian SET 权限人员=:qxry WHERE ID =:id";
            OracleParameter[] parmsQuanXian 
= {new OracleParameter(":qxry", OracleType.VarChar, 1024),
            
new OracleParameter(":id", OracleType.Char, 32)
            }
;
            parmsQuanXian[
0].Value = this.TextBoxQuanXianRenYuan.Text.Trim();
            parmsQuanXian[
1].Value = this.GridViewXinXiLan.DataKeys[this.GridViewXinXiLan.SelectedRow.RowIndex][1].ToString().Trim();

            OracleConnection conn 
= new OracleConnection(OracleHelper.DatabaseConnStr);
            conn.Open();
            OracleTransaction trans 
= conn.BeginTransaction(IsolationLevel.ReadCommitted);

            
try
            
{
               OracleHelper.ExecuteNonQuery(trans, CommandType.Text, sqlUpdate, parms);
               OracleHelper.ExecuteNonQuery(trans, CommandType.Text, sqlChildUpdate, parmsQuanXian);
               trans.Commit();
            }

            
catch (Exception ex)
            
{
                trans.Rollback();
                ex.ToString();
            }

            
finally
            
{
                conn.Close();
            }

        }



        
/// <summary>
        
/// 查阅详细信息 更新阅读次数
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void ReviewData()
        
{
            
// 主键
            primaryKey = this.GridViewXinXiLan.DataKeys[this.GridViewXinXiLan.SelectedRow.RowIndex][0].ToString();
            
// 标题
            this.TextBoxXinXiBiaoTi.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[3].Text.ToString();
            
// 建立日期
            this.TextBoxJianLiRiQi.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[2].Text.ToString();
            
// 发布部门
            this.TextBoxFaBuBuMen.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[4].Text.ToString();
            
// 经办人
            this.TextBoxJinBanRen.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[5].Text.ToString();
            
// 信息类型
            this.DropDownListXinXiLeiXing.Items.Remove(this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[6].Text.ToString().Trim());
            
this.DropDownListXinXiLeiXing.Items.Insert(0this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[6].Text.ToString().Trim());
            
            
// 信息内容
            int actual = 0;
            String conn 
= OracleHelper.DatabaseConnStr;
            String getConent 
= "SELECT 信息内容,审批人 FROM xinxi WHERE SN =" +"'" + primaryKey + "'";
            OracleDataReader dr 
= OracleHelper.ExecuteReader(conn, CommandType.Text, getConent, null);
            
while (dr.Read())
            
{
                OracleLob myOracleClob 
= dr.GetOracleLob(0);

                StreamReader streamreader 
= new StreamReader(myOracleClob, Encoding.Unicode);
                
char[] cbuffer = new char[1000000];
                
while ((actual = streamreader.Read(cbuffer, 0, cbuffer.Length)) > 0)
                
{
                    String content 
= new string(cbuffer, 0, actual);
                    
this.FreeTextBoxXinXiNeiRong.Text = content;
                }

                
// 审批人
                this.TextBoxShenPiRen.Text = dr.GetString(1);
            }

            dr.Close();

            
// 关键字
            this.TextBoxGuanJianZi.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[7].Text.ToString();
            
// 阅读次数
            this.TextBoxYueDuCiShu.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[8].Text.ToString();
            
// 更新阅读次数 +1
            String updateReadCount = "UPDATE xinxi SET 阅读次数=阅读次数+1 WHERE SN=" + "'" + primaryKey + "'";
            
int readCount = OracleHelper.ExecuteNonQuery(conn, CommandType.Text, updateReadCount, null);
    }


        
/// <summary>
        
/// 根据操作类型进行跳转操作
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void ButtonCaoZuo_Click(object sender, EventArgs e)
        
{
            
switch (this.ButtonCaoZuo.Text)
            
{
                
case "添加信息": AddInformation();
                    
break;
                
case "更新信息": UpdateInformation(); 
                    
break;

                
defaultbreak;
            }

        }


        
/// <summary>
        
/// 编辑按钮点击
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void ButtonBianJi_Click(object sender, EventArgs e)
        
{
            
if (this.GridViewXinXiLan.SelectedRow != null)
            
{
                
// 假如有审批意见则不可以修改 通过判断审批意见是否为空得到
                if (this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[9].Text.Trim() == "&nbsp;")
                
{
                    
this.MenuCaidan.Items[3].Enabled = true;
                    MenuCaidan.Items[
3].Selected = true;
                    MultiViewXinXiGuanLi.ActiveViewIndex 
= 1;
                    
this.ButtonCaoZuo.Text = "更新信息";
                    
// 调用更新信息
                    EditInformation();
                    
// 设置控件
                    this.LabelStarBiaoTi.Visible = true;
                    
this.LabelStarGuanJianZi.Visible = true;
                    
this.LabelStarNeiRong.Visible = true;
                    
this.LabelStarShenPiRen.Visible = true;

                    
this.TextBoxQuanXianRenYuan.Visible = true;
                    
this.TextBoxQuanXianRenYuan.Enabled = true;

                    
this.LabelQuanXianRenYuan.Visible = true;
                    
this.LabelShenPiRen.Visible = true;

                    
this.TextBoxShenPiRen.Visible = true;
                    
this.TextBoxShenPiRen.Enabled = true;

                    
this.ButtonTianFaBuBuMen.Visible = true;
                    
this.ButtonTianFaBuBuMen.Enabled = true;

                    
this.ButtonTianXuanZeQuanXian.Enabled = true;
                    
this.ButtonTianXuanZeQuanXian.Visible = true;

                    
this.LabelShenPiJieGuo.Visible = false;
                    
this.TextBoxShenPiJieGuo.Visible = false;
                    
this.TextBoxShenPiJieGuo.Enabled = false;

                    
this.LabelShenPiYiJian.Visible = false;
                    
this.FreeTextBoxShenPiYiJian.Visible = false;

                    
this.ButtonTianXuanZeQuanXian.Visible = true;
                    
this.LabelQuanXianRenYuan.Visible = true;

                    
this.LabelFaBuBUMen.Visible = true;
                    
this.TextBoxFaBuBuMen.Visible = true;
                    
this.TextBoxFaBuBuMen.Enabled = true;

                    
this.ButtonCaoZuo.Enabled = true;
                    
this.ButtonCaoZuo.Visible = true;
                }

            }

            
else
            
{
                
// 错误信息提示
                String tip = "请选择行!";
                Response.Write(
"<script>alert('"+ tip +"')</script>"); 
            }

        }


        
/// <summary>
        
/// 查阅信息
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void ButtonChaYue_Click(object sender, EventArgs e)
        
{
            
// 选择信息不为空
            if (this.GridViewXinXiLan.SelectedRow != null)
            
{
                
this.MenuCaidan.Items[1].Enabled = true;
                MenuCaidan.Items[
1].Selected = true;
                MultiViewXinXiGuanLi.ActiveViewIndex 
= 1;

                
this.ButtonCaoZuo.Text = "查阅信息";
                
this.ButtonCaoZuo.Enabled = false;
                
this.ButtonCaoZuo.Visible = false;

                
// 显示查阅数据
                ReviewData();

                
// 控件设置
                this.LabelStarBiaoTi.Visible = false;
                
this.LabelStarGuanJianZi.Visible = false;
                
this.LabelStarNeiRong.Visible = false;
                
this.LabelStarShenPiRen.Visible = false;

                
this.TextBoxFaBuBuMen.Enabled = true;

                
this.TextBoxQuanXianRenYuan.Visible = false;
                
this.TextBoxQuanXianRenYuan.Enabled = false;

                
this.LabelQuanXianRenYuan.Visible = false;
                
this.LabelShenPiRen.Visible = false;

                
this.TextBoxShenPiRen.Visible = false;
                
this.TextBoxShenPiRen.Enabled = false;

                
this.ButtonTianFaBuBuMen.Visible = false;
                
this.ButtonTianFaBuBuMen.Enabled = false;

                
this.ButtonTianXuanZeQuanXian.Enabled = false;
                
this.ButtonTianXuanZeQuanXian.Visible = false;

                
this.TextBoxJinBanRen.BackColor = System.Drawing.Color.FromArgb(255255255);
                
this.TextBoxJianLiRiQi.BackColor = System.Drawing.Color.FromArgb(255255255);

                
this.LabelShenPiYiJian.Visible = false;
                
this.FreeTextBoxShenPiYiJian.Visible = false;

                
this.LabelShenPiJieGuo.Visible = false;
                
this.TextBoxShenPiJieGuo.Visible = false;
            }

            
else
            
{
                
// 错误信息提示
                String tip = "请选择行!";
                Response.Write(
"<script>alert('" + tip + "')</script>");
            }

        }



        
/// <summary>
        
/// 查看审批意见
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void ButtonShenPiYiJian_Click(object sender, EventArgs e)
        
{
            
// 选择信息不为空
            if (this.GridViewXinXiLan.SelectedRow != null)           
            
{
                
this.MenuCaidan.Items[4].Enabled = true;
                MenuCaidan.Items[
4].Selected = true;
                MultiViewXinXiGuanLi.ActiveViewIndex 
= 1;

                
// 主键
                primaryKey = this.GridViewXinXiLan.DataKeys[this.GridViewXinXiLan.SelectedRow.RowIndex][0].ToString();
                
// 标题
                this.TextBoxXinXiBiaoTi.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[3].Text.ToString();
                
// 建立日期
                this.TextBoxJianLiRiQi.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[2].Text.ToString();
                
this.TextBoxJianLiRiQi.BackColor = System.Drawing.Color.FromArgb(255255255);
                
// 发布部门
                this.TextBoxFaBuBuMen.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[4].Text.ToString();
                
this.ButtonTianFaBuBuMen.Visible = false;
                
this.ButtonTianFaBuBuMen.Enabled = false;
                
// 经办人
                this.TextBoxJinBanRen.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[5].Text.ToString();
                
this.TextBoxJinBanRen.ReadOnly = false;
                
this.TextBoxJinBanRen.BackColor = System.Drawing.Color.FromArgb(255255255);
                
// 信息类型
                this.DropDownListXinXiLeiXing.Items.Remove(this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[6].Text.ToString().Trim());
                
this.DropDownListXinXiLeiXing.Items.Insert(0this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[6].Text.ToString().Trim());
                
// 信息内容
                int actual = 0;
                String conn 
= OracleHelper.DatabaseConnStr;
                String getConent 
= "SELECT 信息内容,审批人 FROM xinxi WHERE SN =" + "'" + primaryKey + "'";
                OracleDataReader dr 
= OracleHelper.ExecuteReader(conn, CommandType.Text, getConent, null);
                
while (dr.Read())
                
{
                    OracleLob myOracleClob 
= dr.GetOracleLob(0);

                    StreamReader streamreader 
= new StreamReader(myOracleClob, Encoding.Unicode);
                    
char[] cbuffer = new char[1000000];
                    
while ((actual = streamreader.Read(cbuffer, 0, cbuffer.Length)) > 0)
                    
{
                        String content 
= new string(cbuffer, 0, actual);
                        
this.FreeTextBoxXinXiNeiRong.Text = content;
                    }

                    
// 审批人 
                    this.TextBoxShenPiRen.Text = dr.GetString(1);
                }

                dr.Close();

                
// 获取权限人员 
                String getRights = "SELECT 权限人员 FROM xinxiquanxian WHERE ID = " + "'" + primaryKey + "'";
                OracleDataReader rd 
= OracleHelper.ExecuteReader(conn, CommandType.Text, getRights, null);
                
while (rd.Read())
                
{
                    
// 审批人 
                    this.TextBoxQuanXianRenYuan.Text = rd.GetString(0);
                }

                rd.Close();
                
this.ButtonTianXuanZeQuanXian.Visible = false;
                
this.ButtonTianXuanZeQuanXian.Enabled = false;
                
// 关键字
                this.TextBoxGuanJianZi.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[7].Text.ToString();
                
// 阅读次数
                this.TextBoxYueDuCiShu.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[8].Text.ToString();
                
// 审批结果
                this.LabelShenPiJieGuo.Visible = true;
                
this.TextBoxShenPiJieGuo.Visible = true;
                
this.TextBoxShenPiJieGuo.Enabled = true;
                
this.TextBoxShenPiJieGuo.Text = this.GridViewXinXiLan.Rows[this.GridViewXinXiLan.SelectedRow.RowIndex].Cells[9].Text.ToString();
                
                
// 审批意见
                this.LabelShenPiYiJian.Visible = true;
                
this.FreeTextBoxShenPiYiJian.Visible = true;

                
int length = 0;
                String getAdvice 
= "SELECT 审批意见 FROM xinxishenpi WHERE ID =" + "'" + primaryKey + "'";
                OracleDataReader datar 
= OracleHelper.ExecuteReader(conn, CommandType.Text, getAdvice, null);
                
while (datar.Read())
                
{
                    OracleLob myOracleClob 
= datar.GetOracleLob(0);

                    StreamReader streamreader 
= new StreamReader(myOracleClob, Encoding.Unicode);
                    
char[] cbuffer = new char[1000000];
                    
while ((length = streamreader.Read(cbuffer, 0, cbuffer.Length)) > 0)
                    
{
                        String content 
= new string(cbuffer, 0, length);
                        
this.FreeTextBoxShenPiYiJian.Text = content;
                    }


                }

                datar.Close();

                
this.ButtonCaoZuo.Visible = false;
                
this.ButtonCaoZuo.Enabled = false;

            }

            
else
            
{
                
// 错误信息提示
                String tip = "请选择行!";
                Response.Write(
"<script>alert('" + tip + "')</script>");
            }

        }


        
/// <summary>
        
/// 隐藏列
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void GridViewXinXiLan_RowCreated(object sender, GridViewRowEventArgs e)
        
{
            
if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header)
            
{
                
// 隐藏第10列 为SN
                e.Row.Cells[10].Visible = false;
            }
 
        }



        
/// <summary>
        
/// 首页,上一页,下一页,尾页公用的点击程序
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void PagerButtonClick(object sender, EventArgs e)
        
{
            
// CommandArgument对应该对象在页面初始化后的设定值
            
// 减1 是因为系统默认首页的PageIndex为0,为了符合人们的正常思维而使用
            
// 重新绑定
            GridViewXinXiLan.DataSource = ViewState["GridViewXinXiLan_DataSource"];
            GridViewXinXiLan.PageIndex 
= Convert.ToInt32(((LinkButton)sender).CommandArgument) - 1;
            GridViewXinXiLan.DataBind();
            
// 更新当前页面显示值
            lblCurrentIndex.Text = "第 " + (GridViewXinXiLan.PageIndex + 1).ToString() + " 页";

        }


        
/// <summary>
        
/// 分页的相关参数设置
        
/// </summary>
        
/// <param name="ds"></param>

        protected void getRefSet(DataSet ds)
        
{
            lblCurrentIndex.Text 
= "第 " + (GridViewXinXiLan.PageIndex + 1).ToString() + " 页";
            lblPageCount.Text 
= "共 " + GridViewXinXiLan.PageCount.ToString() + " 页";
            lblRecordCount.Text 
= "总共 " + ds.Tables[0].Rows.Count.ToString() + " 条";

            
if (ds.Tables[0].Rows.Count == 0)
            
{
                lnkbtnFirst.Visible 
= false;
                lnkbtnPre.Visible 
= false;
                lnkbtnNext.Visible 
= false;
                lnkbtnLast.Visible 
= false;

                lblCurrentIndex.Visible 
= false;
                lblPageCount.Visible 
= false;
                lblRecordCount.Visible 
= false;
                
this.lnkbtnJumpPage.Visible = false;
                
this.txtJumpPage.Visible = false;
            }

            
else if (GridViewXinXiLan.PageCount == 1)
            
{
                lnkbtnFirst.Visible 
= false;
                lnkbtnPre.Visible 
= false;
                lnkbtnNext.Visible 
= false;
                lnkbtnLast.Visible 
= false;
            }


            
// 设置LinkButton此时对应的参数
            lnkbtnFirst.CommandArgument = "1";
            lnkbtnPre.CommandArgument 
= (GridViewXinXiLan.PageIndex == 0 ? "1" : GridViewXinXiLan.PageIndex.ToString());
            lnkbtnNext.CommandArgument 
= (GridViewXinXiLan.PageCount == 1 ? GridViewXinXiLan.PageCount.ToString() : (GridViewXinXiLan.PageIndex + 2).ToString());
            lnkbtnLast.CommandArgument 
= GridViewXinXiLan.PageCount.ToString();

        }


    
/// <summary>
    
/// 跳转到指定页面,页面参数由txtJumpPage获取
    
/// </summary>
    
/// <param name="sender"></param>
    
/// <param name="e"></param>

        protected void lnkbtnJumpPage_Click(object sender, EventArgs e)
        
{
            
// 减1 是因为系统默认首页的PageIndex为0,为了符合人们的正常思维而使用
            
// 重新绑定
            GridViewXinXiLan.DataSource = ViewState["GridViewXinXiLan_DataSource"];
            GridViewXinXiLan.PageIndex 
= int.Parse(txtJumpPage.Text) - 1;
            GridViewXinXiLan.DataBind();
            
// 更新当前页面显示值
            lblCurrentIndex.Text = "第 " + (GridViewXinXiLan.PageIndex + 1).ToString() + " 页";

        }


        
/// <summary>
        
/// 删除选择列
        
/// </summary>
        
/// <param name="sender"></param>
        
/// <param name="e"></param>

        protected void ButtonShanChu_Click(object sender, EventArgs e)
        
{
            
// 选择数组
            ArrayList selectedItems = new ArrayList();

            
for (int i = 0; i < this.GridViewXinXiLan.Rows.Count; i++)
            
{
                
string id = this.GridViewXinXiLan.DataKeys[i][0].ToString();
                CheckBox cb 
= this.GridViewXinXiLan.Rows[i].FindControl("CheckBoxFuXuan"as CheckBox;
                
if (selectedItems.Contains(id) && !cb.Checked)
                
{
                    selectedItems.Remove(id);
                }

                
if (!selectedItems.Contains(id) && cb.Checked)
                
{
                    selectedItems.Add(id);
                }

            }

            
            
// 判断是否有复选框被选择
            if (selectedItems.Count == 0)
            
{
                
// 错误信息提示
                String tip = "请选择行!";
                Response.Write(
"<script>alert('" + tip + "')</script>");
                
return;
            }

            
// 一个个删除
            foreach (object tmp in selectedItems)
            

                
// 删除 需要开启事务
                
// 删除信息表
                String delXinXiSql = "DELETE FROM xinxi WHERE SN = " + "'"+ tmp.ToString().Trim() +"'";
                
// 删除相关权限表
                String delXinXiQuanXianSql = "DELETE FROM xinxiquanxian WHERE ID = " + "'" + tmp.ToString().Trim() + "'";
                
// 删除相关审批表
                String delXinXiShenPiSql = "DELETE FROM xinxishenpi WHERE ID = " + "'" + tmp.ToString().Trim() + "'";

                OracleConnection conn 
= new OracleConnection(OracleHelper.DatabaseConnStr);
                conn.Open();
                OracleTransaction trans 
= conn.BeginTransaction(IsolationLevel.ReadCommitted);

                
try
                
{
                    OracleHelper.ExecuteNonQuery(trans, CommandType.Text, delXinXiSql, 
null);
                    OracleHelper.ExecuteNonQuery(trans, CommandType.Text, delXinXiQuanXianSql, 
null);
                    OracleHelper.ExecuteNonQuery(trans, CommandType.Text, delXinXiShenPiSql, 
null);
                    trans.Commit();
                }

                
catch (Exception ex)
                
{
                    trans.Rollback();
                    ex.ToString();
                }

                
finally
                
{
                    conn.Close();
                }


            }


            
// 刷新删除页面
            
// 读取数据源 设定显示值 并绑定
            
// 保存SQL语句
            String sql = ViewState["sql"].ToString();
            fillGridView(ViewState[
"sql"].ToString());
            
// 获取字符串中的字符正则表达式 并转换为整形 
            this.GridViewXinXiLan.PageIndex = Convert.ToInt32(System.Text.RegularExpressions.Regex.Replace(this.lblCurrentIndex.Text, @"[^d]*""")) - 1
        }


    }

}

 3 数据库

CREATE TABLE "HHSYS"."XINXI" ("建立日期" CHAR(10 byte) NOT NULL, "信息标题"
    VARCHAR2(255 byte) NOT NULL, "发布部门" CHAR(64 byte) NOT NULL, "经办人"
    CHAR(20 byte) NOT NULL, "信息类型" CHAR(8 byte) NOT NULL, "信息内容"
    CLOB NOT NULL, "关键字" CHAR(128 byte) NOT NULL, "阅读次数"
    NUMBER(10) DEFAULT 0 NOT NULL, "审批人" CHAR(20 byte) NOT NULL,
    "审批结果" CHAR(10 byte), "更新时间" CHAR(20 byte), "SN" CHAR(32
    byte) NOT NULL) 
    TABLESPACE "HHNFXP" PCTFREE 10 PCTUSED 40 INITRANS 1
    MAXTRANS 255
    STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
    2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1)
    LOGGING LOB("信息内容") STORE AS (  TABLESPACE "HHNFXP" 
    STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
    2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1)
    ENABLE
    STORAGE IN ROW
    NOCACHE CHUNK 4096 PCTVERSION 10)

CREATE TABLE "HHSYS"."XINXIQUANXIAN" ("ID" CHAR(32 byte) NOT NULL,
    "权限人员" VARCHAR2(1024 byte) NOT NULL, "SN" CHAR(32 byte) NOT
    NULL) 
    TABLESPACE "HHNFXP" PCTFREE 10 PCTUSED 40 INITRANS 1
    MAXTRANS 255
    STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
    2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1)
    LOGGING

CREATE TABLE "HHSYS"."XINXISHENPI" ("ID" CHAR(32 byte) NOT NULL, "审批人"
    CHAR(20 byte) NOT NULL, "审批意见" CLOB, "审批时间" CHAR(20 byte), "SN"
    CHAR(32 byte) NOT NULL) 
    TABLESPACE "HHNFXP" PCTFREE 10 PCTUSED 40 INITRANS 1
    MAXTRANS 255
    STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
    2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1)
    LOGGING LOB("审批意见") STORE AS (  TABLESPACE "HHNFXP" 
    STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
    2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1)
    ENABLE
    STORAGE IN ROW
    NOCACHE CHUNK 4096 PCTVERSION 10)

CREATE TABLE "HHSYS"."XITONGZIDIAN" ("序号" NUMBER(8) NOT NULL, "名称"
    CHAR(30 byte) NOT NULL, "模块类别" CHAR(8 byte) NOT NULL, "ID"
    CHAR(10 byte) NOT NULL, "SN" CHAR(32 byte) NOT NULL) 
    TABLESPACE "HHNFXP" PCTFREE 10 PCTUSED 40 INITRANS 1
    MAXTRANS 255
    STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
    2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1)
    LOGGING

代码测试通过

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值