`

对文档库和列表进行的一些基本操作(转)

 
阅读更多


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.Data.SqlClient;
using System.IO;
using Microsoft.SharePoint;
using yesinda.yesindakms.sharepoint;
using yesinda.yesindakms.sharepoint.List;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.Utilities;

public partial class usercontrol_CreateNewDoc : System.Web.UI.UserControl
{
定义变量和属性定义变量和属性#region 定义变量和属性
private SPList list9;
private SPListItemCollection items;
public string Url = String.Empty; //保存文档库根文件夹路径
public string HostName = String.Empty; //存放主机名

private string siteUrl = "/dept/gsb/";
public string SiteUrl
{
get { return this.siteUrl; }
set { siteUrl = value; }
}
#endregion

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//绑定DropDownList控件
BindControl();
//绑定TreeView控件
TreeViewBind(this.TreeView1);
TreeViewBind(this.TreeView2);
//AddUserTreeNode(this.TreeView3);
//绑定GridView数据控件
BindGrid();

HostName = Request.UserHostName;
}
}

为TreeView添加节点为TreeView添加节点#region 为TreeView添加节点
/**//**//**//// <summary>
/// 为TreeView添加节点
/// </summary>
/// <param name="parentFolder"></param>
/// <param name="parentNode"></param>
private void AddChild(SPFolder parentFolder, TreeNode parentNode)
{
if (parentFolder.SubFolders.Count == 0)
return;
foreach (SPFolder f in parentFolder.SubFolders)
{
if (f.Name != "Forms" && f.Name.IndexOf("_") != 0)
{
TreeNode child = new TreeNode(f.Name, f.ServerRelativeUrl);
parentNode.ChildNodes.Add(child);
AddChild(f, child);
}
}
}
#endregion

绑定TreeView控件绑定TreeView控件#region 绑定TreeView控件
/**//**//**//// <summary>
/// 绑定TreeView控件
/// </summary>
protected void TreeViewBind(TreeView treeview)
{
SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/dept/gsb/", this.Context);
sps.AllowUnsafeUpdates = true;
SPWeb spw = sps.OpenWeb();
spw.AllowUnsafeUpdates = true;

SPWebCollection sites = sps.AllWebs;
foreach (SPWeb site in sites)
{
SPListCollection lists = site.Lists;
foreach (SPList list in lists)
{
if (list.BaseType == SPBaseType.DocumentLibrary && list.BaseTemplate != SPListTemplateType.ListTemplateCatalog
&& list.BaseTemplate == SPListTemplateType.DocumentLibrary)
{
list9 = spw.Lists[list.Title];
items = list9.Items;
SPFolder root = list.RootFolder;
TreeNode rootNode = new TreeNode(list.Title, root.Url);
treeview.Nodes.Add(rootNode);
AddChild(root, rootNode);
}
}
}
}
#endregion

创建数据源创建数据源#region 创建数据源
/**//**//**//// <summary>
/// 创建数据源
/// </summary>
/// <returns></returns>
ICollection CreateDataSource()
{
DataTable dt = new DataTable("mytable"); //创建一个名为mytable的DataTable对象形
DataColumn dc = new DataColumn(); //创建一个列对象
dc.DataType = System.Type.GetType("System.String"); //指定该列的数据类型
dc.Caption = "DocID"; //设置列的标题
dc.ColumnName = "文档库ID"; //设置 列集合对象中的列的名称,datagrid中显示该列名.
dt.Columns.Add(dc); //将该列对象加入到表mytable的列集合中
//普通列
DataColumn dc1 = new DataColumn();
dc1.DataType = System.Type.GetType("System.String");
dc1.AllowDBNull = false;
dc1.Caption = "Path";
dc1.ColumnName = "路径";
dt.Columns.Add(dc1);

DataColumn dc2 = new DataColumn();
dc2.DataType = System.Type.GetType("System.String");
dc2.AllowDBNull = false;
dc2.Caption = "FullPath";
dc2.ColumnName = "完整路径";
dc2.DefaultValue = 25;
dt.Columns.Add(dc2);

SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/dept/gsb/", this.Context);
sps.AllowUnsafeUpdates = true;
SPWeb spw = sps.OpenWeb();
spw.AllowUnsafeUpdates = true;

SPWebCollection sites = sps.AllWebs;
foreach (SPWeb site in sites)
{
SPListCollection lists = site.Lists;
foreach (SPList list in lists)
{
if (list.BaseType == SPBaseType.DocumentLibrary && list.BaseTemplate != SPListTemplateType.ListTemplateCatalog
&& list.BaseTemplate== SPListTemplateType.DocumentLibrary)
{
if (dt != null)
{
DataRow dr = dt.NewRow();
dr[0] = list.Title;
dr[1] = list.RootFolder.ServerRelativeUrl;
dr[2] = "http://" + sps.HostName + list.RootFolder.ServerRelativeUrl;
dt.Rows.Add(dr);
}
}
}
}

DataView dv = new DataView(dt);
return dv;
}

/**//**//**//// <summary>
/// 根据路径,动态创建数据源
/// </summary>
/// <returns></returns>
ICollection CreateDataSource(string folderpath)
{
DataTable dt = new DataTable("mytable"); //创建一个名为mytable的DataTable对象形
DataColumn dc = new DataColumn(); //创建一个列对象
dc.DataType = System.Type.GetType("System.Int32"); //指定该列的数据类型
dc.AutoIncrement = true; //该列为自动增涨列
dc.AutoIncrementSeed = 1; //初始值
dc.AutoIncrementStep = 2; //增量
dc.Caption = "DocID"; //设置列的标题
dc.ColumnName = "文档库ID"; //设置 列集合对象中的列的名称,datagrid中显示该列名.
dt.Columns.Add(dc); //将该列对象加入到表mytable的列集合中
//普通列
DataColumn dc1 = new DataColumn();
dc1.DataType = System.Type.GetType("System.String");
dc1.AllowDBNull = false;
dc1.Caption = "Path";
dc1.ColumnName = "路径";
dt.Columns.Add(dc1);

DataColumn dc2 = new DataColumn();
dc2.DataType = System.Type.GetType("System.String");
dc2.AllowDBNull = false;
dc2.Caption = "FullPath";
dc2.ColumnName = "完整路径";
dc2.DefaultValue = 25;
dt.Columns.Add(dc2);

SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/dept/gsb/", this.Context);
sps.AllowUnsafeUpdates = true;
SPWeb spw = sps.OpenWeb();
spw.AllowUnsafeUpdates = true;

SPFolder f = spw.GetFolder(folderpath);

foreach (SPFile file in f.Files)
{
if (dt != null)
{
DataRow dr = dt.NewRow();
dr[0] = file.Item.ID;
dr[1] = file.ServerRelativeUrl;
dr[2] = "http://" + sps.HostName + file.ServerRelativeUrl;
dt.Rows.Add(dr);
}
}
DataView dv = new DataView(dt);
return dv;
}

/**//**//**//// <summary>
///读取所有为文档库类型的列表,创建数据源
/// </summary>
/// <returns></returns>
ICollection MyDataSource()
{
DataTable dt = new DataTable("mytable"); //创建一个名为mytable的DataTable对象形
DataColumn dc = new DataColumn(); //创建一个列对象
dc.DataType = System.Type.GetType("System.Int32"); //指定该列的数据类型
dc.AutoIncrement = true; //该列为自动增涨列
dc.AutoIncrementSeed = 1; //初始值
dc.AutoIncrementStep = 2; //增量
dc.Caption = "DocID"; //设置列的标题
dc.ColumnName = "文档库ID"; //设置 列集合对象中的列的名称,datagrid中显示该列名.
dt.Columns.Add(dc); //将该列对象加入到表mytable的列集合中
//普通列
DataColumn dc1 = new DataColumn();
dc1.DataType = System.Type.GetType("System.String");
dc1.AllowDBNull = false;
dc1.Caption = "Path";
dc1.ColumnName = "路径";
dt.Columns.Add(dc1);

DataColumn dc2 = new DataColumn();
dc2.DataType = System.Type.GetType("System.String");
dc2.AllowDBNull = false;
dc2.Caption = "FullPath";
dc2.ColumnName = "完整路径";
dc2.DefaultValue = 25;
dt.Columns.Add(dc2);

SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/dept/gsb/", this.Context);
sps.AllowUnsafeUpdates = true;
SPWebCollection sites = sps.AllWebs;

foreach (SPWeb site in sites)
{
SPListCollection lists = site.Lists;

foreach (SPList list in lists)
{
if (list.BaseType == SPBaseType.DocumentLibrary && list.BaseTemplate != SPListTemplateType.ListTemplateCatalog
&& list.BaseTemplate == SPListTemplateType.DocumentLibrary)
{
SPDocumentLibrary docLibrary = (SPDocumentLibrary)list;

if (!docLibrary.IsCatalog && list.BaseTemplate !=
SPListTemplateType.XMLForm)
{
SPListItemCollection docLibItems = docLibrary.Items;
foreach (SPListItem docLibItem in docLibItems)
{
if (dt != null)
{
DataRow dr = dt.NewRow();
dr[0] = docLibItem.ID ;
dr[1] = docLibItem.Url;
dr[2] = "http://" + sps.HostName + docLibItem.File.ServerRelativeUrl;
dt.Rows.Add(dr);
}
}
}
}
}
}

DataView dv = new DataView(dt);
return dv;
}
#endregion

绑定控件绑定控件#region 绑定控件
/**//**//**//// <summary>
/// 绑定DropDownList控件
/// </summary>
protected void BindControl()
{
this.ddlDocTitle1.DataSource = CreateDataSource();
this.ddlDocTitle1.DataTextField = "文档库ID";
this.ddlDocTitle1.DataValueField = "路径";
this.ddlDocTitle1.DataBind();

this.ddlDocTitle2.DataSource = CreateDataSource();
this.ddlDocTitle2.DataTextField = "文档库ID";
this.ddlDocTitle2.DataValueField = "路径";
this.ddlDocTitle2.DataBind();
}
/**//**//**//// <summary>
/// 绑定GridView控件
/// </summary>
protected void BindGrid()
{
if (ViewState["FromPath"] != null)
{
this.GridView1.DataKeyNames = new string[] { "文档库ID" };
this.GridView1.DataSource = CreateDataSource(ViewState["FromPath"].ToString());
this.GridView1.DataBind();
}

this.GridView2.DataKeyNames = new string[] { "文档库ID" };
this.GridView2.DataSource = MyDataSource();
this.GridView2.DataBind();
}

/**//**//**//// <summary>
/// 显示系统用户
/// </summary>
/// <param name="treeview"></param>
protected void AddUserTreeNode(TreeView treeview)
{
SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/dept/gsb/", this.Context);
sps.AllowUnsafeUpdates = true;
SPWeb spw = sps.OpenWeb();
spw.AllowUnsafeUpdates = true;


SPUserCollection users = spw.AllUsers;
SPGroupCollection groups = spw.Groups;

foreach (SPGroup group in groups)
{
Response.Write(group.Name + " " + group.ID + "<br>");
}
foreach (SPUser user in users)
{
Response.Write(user.Name + " " + user.ID + "<br>");
}
}
#endregion

发送文档发送文档#region 发送文档
/**//**//**//// <summary>
/// 发送文档
/// </summary>
protected void SendDocument()
{
SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/dept/gsb/", this.Context);
sps.AllowUnsafeUpdates = true;
SPWeb spw = sps.OpenWeb();
spw.AllowUnsafeUpdates = true;

将指定的文档发送到指定的文档库将指定的文档发送到指定的文档库#region 将指定的文档发送到指定的文档库
ArrayList arylst = new ArrayList();
//选择行,获取行中文档的地址
for (int rowindex = 0; rowindex < this.GridView1.Rows.Count; rowindex++)
{
if (((CheckBox)this.GridView1.Rows[rowindex].Cells[0].FindControl("CheckBox1")).Checked == true)
{
arylst.Add(this.GridView1.Rows[rowindex].Cells[2].Text);
}
}
SPFolder f = spw.GetFolder(ViewState["FromPath"].ToString());
for (int j = 0; j < arylst.Count; j++)
{
SPFile file = f.Files[arylst[j].ToString()];
byte[] bytes = f.Files[file.Name].OpenBinary();

//复制文档到指定的文件夹,适合如跨网站复制文件
SPFolder folder = spw.GetFolder(ViewState["ToPath"].ToString()); ;
bool ex = false;
if (folder.Exists)
{
try
{
ex = folder.Files[file.Name].Exists;
Response.Write("<script language="javascript">alert('已有相同名称的文件存在');</script>");
return;
}
catch
{
ex = false;
folder.Files.Add(file.Name, bytes, true);
Response.Write("<script language="javascript">alert('上传成功!');</script>");
}
}
}

#endregion

发送前给文档受权发送前给文档受权#region 发送前给文档受权
//文档受权
#endregion
}
#endregion

权限控制权限控制#region 权限控制
/**//**//**//// <summary>
/// 给条目授与多个权限
/// </summary>
/// <param name="itemId"></param>
/// <param name="userOrGroupName"></param>
/// <param name="types"></param>
public void AssignRights(int itemId, string userOrGroupName, SPRoleType[] types)
{
SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/dept/gsb/", this.Context);
sps.AllowUnsafeUpdates = true;
SPWeb spw = sps.OpenWeb();
spw.AllowUnsafeUpdates = true;
SPList list = spw.Lists["文档模板"];

//取得定义的ID
SPListItem item = list.GetItemById(itemId);
//新的权限集合
SPRoleAssignment nrole = new SPRoleAssignment(list.ParentWeb.AllUsers[userOrGroupName]);
//清空列表项原有权限
nrole.RoleDefinitionBindings.RemoveAll();
//取得站点的权限定义
SPRoleDefinitionCollection roleDefinitions = list.ParentWeb.RoleDefinitions;
foreach (SPRoleType type in types)
{
SPRoleDefinition rdnew = roleDefinitions.GetByType(type);
//绑定权限定义
nrole.RoleDefinitionBindings.Add(rdnew);
}
//添加角色
if (!item.HasUniqueRoleAssignments)
{
item.BreakRoleInheritance(true);
}
item.RoleAssignments.Add(nrole);

item.Update();
}
/**//**//**//// <summary>
/// 给条目授与一个权限
/// </summary>
/// <param name="itemId"></param>
/// <param name="userOrGroupName"></param>
/// <param name="types"></param>
public void AssignRight(int itemId, string userOrGroupName, SPRoleType type)
{
SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/dept/gsb/", this.Context);
sps.AllowUnsafeUpdates = true;
SPWeb spw = sps.OpenWeb();
spw.AllowUnsafeUpdates = true;
SPList list = spw.Lists["文档模板"];

//取得定义的ID
SPListItem item = list.GetItemById(itemId);
//新的权限集合
SPRoleAssignment nrole = new SPRoleAssignment(list.ParentWeb.AllUsers[userOrGroupName]);
//清空列表项原有权限
//nrole.RoleDefinitionBindings.RemoveAll();
//取得站点的权限定义
SPRoleDefinitionCollection roleDefinitions = list.ParentWeb.RoleDefinitions;
SPRoleDefinition rdnew = roleDefinitions.GetByType(type);
//绑定权限定义
nrole.RoleDefinitionBindings.Add(rdnew);
//添加角色
if (!item.HasUniqueRoleAssignments)
{
item.BreakRoleInheritance(true);
}
item.RoleAssignments.Add(nrole);

item.Update();
}
#endregion

上传文档上传文档#region 上传文档
/**//**//**//// <summary>
/// 上传文档到文档库
/// </summary>
/// <param name="filename"></param>
protected void UpLoadDocument()
{
//上传附件添加到文档库,并返回ID,赋给model.Mattachment
string filename = FileUpload1.PostedFile.FileName.Substring(FileUpload1.PostedFile.FileName.LastIndexOf("/") + 1);
Stream filedataStream = FileUpload1.PostedFile.InputStream;
int dataLen = FileUpload1.PostedFile.ContentLength;
string fileType = FileUpload1.PostedFile.ContentType;
byte[] fileData = new byte[dataLen];
filedataStream.Read(fileData, 0, dataLen);

SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/dept/gsb/", this.Context);

sps.AllowUnsafeUpdates = true;
SPWeb spw = sps.OpenWeb();
spw.AllowUnsafeUpdates = true;
SPList list = spw.Lists[this.ddlDocTitle1.SelectedItem.Text];

SPFolder folder = list.RootFolder;
bool ex = false;
if (folder.Exists)
{
try
{
ex = folder.Files[filename].Exists;
Response.Write("<script language="javascript">alert('已有相同名称的文件存在');</script>");
return;
}
catch
{
folder.Files.Add(filename, fileData, true);
}
}
}
#endregion

创建文件夹创建文件夹#region 创建文件夹
/**//**//**//// <summary>
/// 在指定的文档库中创建文件夹
/// </summary>
/// <param name="folderUrl"></param>
/// <param name="folderName"></param>
protected void CreateFolder(string folderUrl,string folderName)
{
SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/dept/gsb/", this.Context);
sps.AllowUnsafeUpdates = true;
SPWeb web = sps.OpenWeb();
web.AllowUnsafeUpdates = true;

SPFolder parent = web.GetFolder(folderUrl);
if (parent.Exists)
{
SPList l = web.Lists.GetList(parent.ParentListId, true);
SPListItem item = l.Folders.Add(folderUrl, SPFileSystemObjectType.Folder);
item["名称"] = "fsfd";
item.Update();
}
}
#endregion

/**//**//**//// <summary>
/// 执行文档上传
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Button1_Click(object sender, EventArgs e)
{
if (this.FileUpload1.FileName != "")
{
UpLoadDocument();
}
}

/**//**//**//// <summary>
/// 选择文档库的路径
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlDocTitle2_SelectedIndexChanged(object sender, EventArgs e)
{
Url = this.ddlDocTitle2.SelectedValue;
}
/**//**//**//// <summary>
/// 将一个文档库中的文档发送到指定文档库
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCopy_Click(object sender, EventArgs e)
{
SendDocument();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//e.Row.Cells[3].Attributes.Add("style", "display:none");
e.Row.Cells[2].Attributes.Add("style", "display:none");
}
protected void Button2_Click(object sender, EventArgs e)
{
ArrayList arylst = new ArrayList();

for (int i = 0; i < this.CheckBoxList1.Items.Count; i++)
{
if (this.CheckBoxList1.Items[i].Selected)
{
arylst.Add(this.CheckBoxList1.Items[i].Value);
}
}

//给每个文档库中的一条设置用户权限
SPRoleType[] types = new SPRoleType[] { SPRoleType.Administrator,SPRoleType.Contributor,SPRoleType.Reader,SPRoleType.WebDesigner };
for (int j = 0; j < arylst.Count; j++)
{
AssignRight(9, this.txtName.Text.Trim(), types[int.Parse(arylst[j].ToString())]);
}
}
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
ViewState["FromPath"] = this.TreeView1.SelectedNode.Value;
BindGrid();
}
protected void TreeView2_SelectedNodeChanged(object sender, EventArgs e)
{
ViewState["ToPath"] = this.TreeView2.SelectedNode.Value;
}
protected void TreeView3_SelectedNodeChanged(object sender, EventArgs e)
{
//Session["DocLibName"] = this.TreeView3.SelectedNode.Value;
}
protected void lnkSendMsg_Command(object sender, CommandEventArgs e)
{
LinkButton lb = (LinkButton)sender;
DataControlFieldCell dcf = (DataControlFieldCell)lb.Parent;
GridViewRow gvr = (GridViewRow)dcf.Parent;
GridView1.SelectedIndex = gvr.RowIndex;

doAddMessageSendReceive(301, DateTime.Now,gvr.Cells[2].Text,"301", gvr.Cells[3].Text);
}

/**//**//**//// <summary>
/// 新增消息
/// </summary>
protected void doAddMessageSendReceive(int receiveid,DateTime sendtime,string msgtitle,string to,string content)
{
Yesidea.Model.Message_SendList modelMessage_SendList = new Yesidea.Model.Message_SendList();
Yesidea.BO.Message_SendList boMessage_SendList = new Yesidea.BO.Message_SendList();

modelMessage_SendList.Sender = receiveid;
modelMessage_SendList.SendTime = sendtime;
modelMessage_SendList.Title = msgtitle;
modelMessage_SendList.Ricivers = to;
modelMessage_SendList.MContent = content;
modelMessage_SendList.Notes = "无";

string[] arr = null;
arr = GetSplitString(to, ",");

boMessage_SendList.AddMessage(modelMessage_SendList, arr);
Response.Write("<script language='javascript'>alert('发送成功');</script>");
}

/**//**//**//// <summary>
/// 拆分字符串成字符串数组
/// </summary>
/// <param name="list"></param>
/// <param name="gap"></param>
/// <returns></returns>
private string[] GetSplitString(string list, string gap)
{
char[] delimiter = gap.ToCharArray();
string[] report = null;
for (int i = 1; i <= list.Length; i++) //把用逗号隔开的字符串拆分成字符串数组report
{
report = list.Split(delimiter, i);
}
return report;
}
protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.GridView2.PageIndex = e.NewPageIndex;
this.GridView2.DataKeyNames = new string[] { "文档库ID" };
this.GridView2.DataSource = MyDataSource();
this.GridView2.DataBind();
}

/**//**//**//// <summary>
/// 选择路径
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlDocTitle2_SelectedIndexChanged1(object sender, EventArgs e)
{
Url = this.ddlDocTitle2.SelectedItem.Value;
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
this.GridView1.PageIndex = e.NewPageIndex;
if (ViewState["FromPath"] != null)
{
this.GridView1.DataKeyNames = new string[] { "文档库ID" };
this.GridView1.DataSource = CreateDataSource(ViewState["FromPath"].ToString());
this.GridView1.DataBind();
}
}
protected void Button1_ServerClick(object sender, EventArgs e)
{
SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/dept/gsb/", this.Context);
sps.AllowUnsafeUpdates = true;
SPWeb web = sps.OpenWeb();
web.AllowUnsafeUpdates = true;

// Create folder as subcolumn
string folderUrl = ColumnTreeBox1.CurrentValue.Trim();
SPFolder parent = web.GetFolder("/dept/gsb/DocLib5/");
Label1.Text = Label1.Text + parent.Url.ToString() + "<br>";
if (parent.Exists)
{
SPList l = web.Lists.GetList(parent.ParentListId, true);
SPDocumentLibrary doc = (SPDocumentLibrary)l;
SPListItem item = l.Items.Add("/dept/gsb/DocLib5", SPFileSystemObjectType.Folder);
Response.Write(siteUrl + folderUrl);
item["名称"] = "fsfd";
item.Update();
string parentUrl = parent.Url;
string currentUrl = parentUrl + "/" + name;

try
{
SPList infoList = web.Lists["栏目信息表"];
SPListItem newItem = infoList.Items.Add();
newItem["全路径"] = currentUrl;
newItem["栏目名"] = name;
newItem["是否顶级"] = false;
if (CheckBox2.Checked)
newItem["是否汇总"] = true;
if (CheckBox3.Checked)
newItem["是否审核"] = true;
if (!CheckBox4.Checked)
newItem["是否显示"] = false;
if (CheckBox5.Checked)
newItem["URL"] = TextBox2.Text;
//以上if语句省去else,因为列表项有默认值
newItem.Update();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
}
}

分享到:
评论

相关推荐

    Jep3.5 数学公式计算 jar包及中文操作手册文档

    53 为可配置的解析器加入和操作操作符 531 修改已存在的操作符 532 优先级和绑定 533 将操作符加入操作符表 534 标准操作符的绑定和优先级 54 使用标准解析器添加操作符 541 编辑标准的解析器语法 55 其他操作符集 ...

    本文档的知识和操作基本上基于DB2数据库

    本文档的知识和操作基本上基于DB2数据库。

    图凌ERP文档库(安卓手机APP应用)

    图凌文档库手机APP应用(随时随地学习ERP知识与软件操作的好助手),该应用支持“离线”“在线”两种阅读方式,支持在线咨询功能,含盖ERP基本概念理论及turingERP(图凌ERP)十余本技术文档及帮助手册。

    git文档.md git基本操作,连接远程仓库

    git操作,添加ssh秘钥,远程连接

    JAVA_API1.6文档(中文)

    javax.naming.spi 提供一些方法来动态地插入对通过 javax.naming 和相关包访问命名和目录服务的支持。 javax.net 提供用于网络应用程序的类。 javax.net.ssl 提供用于安全套接字包的类。 javax.print 为 JavaTM ...

    webService简单示例及开发文档

    Java webService 简单示例 及开发文档

    拓欣文档管理软件-非常好用【中小企业和个人版】

    拓欣电子文档管理系统是一个注重细节和客户体验的系统软件,完全可以满足中小企业和个人对电子文档的管理需求,同时也可根据客户的个性化需求在该平台基础上进行二次开发。 功能特点: 树型目录结构,目录提供索引...

    全国计算机二级WPSoffice精选350道选择题题库(含答案).pdf

    内容包括WPS一站式融合办公的基本概念、WPS应用界面使用和功能设置、WPS中进行PDF文件的阅读、批注、编辑和转换等操作,还有包括WPS云办公应用场景,文件的云备份、云同步、云安全、云共享、云协作等操作。...

    springMongodb参考文档中文版

    2.了解NoSQL和文档数据库 3.要求 4.其他帮助资源 4.1。支持 4.1.1。社区论坛 4.1.2。专业支持 4.2。发展之后 5.新&值得注意的 5.1。Spring Data MongoDB 2.1中的新特性 5.2。Spring Data MongoDB 2.0中的新特性 5.3...

    使用RadioHead库进行基本的LoRa通信源码

    当涉及到不同的LoRa通信模块库时,代码实现会因库的不同而有所变化。以下是一个示例代码框架,演示了使用RadioHead库进行基本的LoRa通信。...确保根据库的文档和示例进行正确的初始化、发送和接收操作。

    易语言对象操作word纯源码

    用对象纯源码实现word的操作,纯绿色,无公害....因此开贴,给新人及我等小白做个总结,以便...本贴关于创建word文档等基本的就不说了,主要是对打开的word文档进行操作,实现了以下主要功能:。主要功能:。1, 表格中定位插入图

    BI Kettle中文文档汇集

    ELT平台操作手册-KETTLE.pdf ETL工具kettle.pdf etl工具kettle公司学习文档.pdf ETL工具kettle学习总结.pdf ETL工具Kettle用户手册3.0.pdf ETL工具Spoon 2.5.0用户手册.pdf KETTLE.pdf kettle_使用中的一些...

    软件资料文档标准规格

     ◇ 用户操作手册:本手册详细描述软件的功能、性能和用户界面,使用户对如何使用该软件得到具体的了解,为操作人员提供该软件各种运行情况的有关知识,特别是操作方法的具体细节。  ◇ 测试计划:为做好集成测试...

    python-3.90 文档 手册 中文版.chm

    讲解基础内容和基本语法 安装和使用 Python 各种操作系统的介绍都有 Python 常用指引 深入了解特定主题 安装 Python 模块 从官方的 PyPI 或者其他来源安装模块 分发 Python 模块 发布模块,供其他人安装 扩展和...

    C++QT实现对pdf、word文档预览以及文本内容的读取

    最近在做一个简历管理工具时遇到了一些需求,在网上找了大量资源信息,发现Qt对pdf、word进行数据读取的信息少之又少,于是根据我自己的摸索,实现了这些需求功能。 功能主要实现了1、对pdf、word文件进行预览显示2...

    实验1 Git基本操作.docx

    云计算原理与实践配套实验文档之 Git基本操作:Git是一个开源的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理。Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的...

    基于Office和VBA的通用图文试题库系统

    对每一道试题的参数、题干和答案,可直接在Word环境中进行增、删、改、排等操作。可随时检测是否有重复题。为醒目起见,系统可自动将试题和答案的参数涂上不同颜色。可对试题和答案的参数进行有效性检验。 2.信息...

    某学校的题库管理系统数据库系统设计

    基本内容:本课题的研究对象试题库管理模块的设计和实现。以下具体功能的介绍:(1):用户登录功能:验证用户登录的合法性,本系统分为教师登录和学生登录两种模式,从数据库中匹配相对应的用户信息,成功登录后自动...

    linux 文档

    让菜鸟成网络新人的文档.很不错的 / :根目录,包含整个 Linux 系统的所有目录和文件 /boot:存放启动 Linux 系统所需的文件(包括内核文件. 映像文件. 启动菜单配置文件) /dev:存放 linux 系统的硬盘. 键盘. 鼠标...

Global site tag (gtag.js) - Google Analytics