大家给看一下啥地方限制名称的?代码如下:
protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
{
Label label = (Label) e.Item.FindControl("lblFilePath");
Button button = (Button) e.Item.FindControl("btnUp");
if (label != null)
{
this.Session["Session_UpLoadRightFlg"] = "1";
string commandName = e.CommandName;
if (commandName != null)
{
if (!(commandName == "LookPath"))
{
string text;
string str2;
if (commandName == "UpFiles")
{
text = e.Item.Cells[0].Text;
str2 = e.CommandArgument.ToString();
this.SaveUpFilesToDataBase(text, str2, e.Item.Cells[2].Text, "2");
this.BindDataGrid();
label.Text = "成功上传";
button.Enabled = false;
}
else if (commandName == "UpOneFile")
{
text = e.Item.Cells[0].Text;
str2 = e.CommandArgument.ToString();
this.UpdateOneFileNew(text, str2, e.Item.Cells[2].Text, "1");
this.BindDataGrid();
}
else if (commandName == "del")
{
string script = "<script>var t=window.showModalDialog('DeleteFile.aspx?case=" + e.CommandArgument.ToString() + "','','dialogHeight=200px;dialogWidth=400px;center=yes;resizable=no;status=no;scroll=yes;help=no'); if(t==true)window.location.reload();</script>";
this.Page.RegisterStartupScript("", script);
}
else if (commandName == "Relation")
{
string str4 = "<script>var t=window.showModalDialog('../../DesktopModules/RelationFlowCase/RelationFlowCase.aspx?CASENO=" + e.CommandArgument.ToString().Split(new char[] { '|' })[0] + "&MATERIALID=" + e.CommandArgument.ToString().Split(new char[] { '|' })[1] + "&FLG=1','','dialogHeight=600px;dialogWidth=800px;center=yes;resizable=yes;status=no;scroll=yes;help=no'); if(t==true)window.location.reload();</script>";
this.Page.RegisterStartupScript("", str4);
}
}
else
{
label.Text = Path.GetFileName(this.txtFilePath.Value);
button.Enabled = true;
}
}
}
} protected void BindDataGrid()
{
this.lblgrouphint.Text = "<font color=blue>批量上传步骤:1、<font color=orange>\"批量上传\"</font> 2、<font color=orange>\"浏览\"</font> 3、<font color=orange>\"上传\"</font> 4、<font color=orange>\"返回\"</font> 5、<font color=orange>\"刷新列表\"</font></font>";
this.VsFileType = ConfigurationManager.AppSettings["ftpFileType"];
this.VsCaseNo = base.Request.QueryString["CaseNo"];
if ((base.Request["ActiveID"] != null) && (base.Request.QueryString["ActiveID"].ToString().Length > 0))
{
this.VsActiveID = base.Request.QueryString["ActiveID"];
}
else
{
DBAccess access = new DBAccess();
string str = "select 流程ID from LANDFLOWGLOB where 案件编号='" + this.VsCaseNo + "'";
string str2 = access.GetFirstColumn(str).ToString();
str = "select 活动ID from FLOWNODE where 流程ID=" + str2 + " and 节点类型=1";
this.VsActiveID = access.GetFirstColumn(str).ToString();
}
this.VsUpFileType = base.Request.QueryString["UpFileType"];
if ((this.VsCaseNo == null) || (this.VsCaseNo == ""))
{
throw new ArgumentNullException("CaseNo");
}
if ((this.VsActiveID == null) || (this.VsActiveID == ""))
{
throw new ArgumentNullException("ActiveID");
}
if ((this.VsCaseNo == null) || (this.VsCaseNo == ""))
{
throw new ArgumentNullException("UpFileType");
}
string strConnection = ConfigurationManager.AppSettings["connecttingstring"].ToString();
string strDatabaseType = ConfigurationManager.AppSettings["DataServerType"].ToString();
DBAccess access2 = new DBAccess(strConnection, strDatabaseType);
string strSql = "select * from CASEMATERIALLIST where CASENO='" + this.VsCaseNo + "' and SIGNINFLAG='1'";
if (this.VsUpFileType.ToUpper() == "ONFLOW")
{
strSql = strSql + " and UPMATERIALTYPE='流程中上传'";
}
if (this.IsZH_CASEMATERIALLIST_Table())
{
strSql = strSql + " and DELETEFLAG=0";
}
string str6 = strSql;
strSql = str6 + " and (ActiveID like '" + this.VsActiveID + ",%' or ActiveID like '%," + this.VsActiveID + ",%' or ActiveID='" + this.VsActiveID + "' or ActiveID like '%," + this.VsActiveID + ",')";
DataSet dataSet = access2.GetDataSet(strSql);
this.DataGrid1.DataSource = dataSet.Tables[0].DefaultView;
this.DataGrid1.DataBind();
}
protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
{
Label label = (Label) e.Item.FindControl("lblFilePath");
Button button = (Button) e.Item.FindControl("btnUp");
if (label != null)
{
this.Session["Session_UpLoadRightFlg"] = "1";
string commandName = e.CommandName;
if (commandName != null)
{
if (!(commandName == "LookPath"))
{
string text;
string str2;
if (commandName == "UpFiles")
{
text = e.Item.Cells[0].Text;
str2 = e.CommandArgument.ToString();
this.SaveUpFilesToDataBase(text, str2, e.Item.Cells[2].Text, "2");
this.BindDataGrid();
label.Text = "成功上传";
button.Enabled = false;
}
else if (commandName == "UpOneFile")
{
text = e.Item.Cells[0].Text;
str2 = e.CommandArgument.ToString();
this.UpdateOneFileNew(text, str2, e.Item.Cells[2].Text, "1");
this.BindDataGrid();
}
else if (commandName == "del")
{
string script = "<script>var t=window.showModalDialog('DeleteFile.aspx?case=" + e.CommandArgument.ToString() + "','','dialogHeight=200px;dialogWidth=400px;center=yes;resizable=no;status=no;scroll=yes;help=no'); if(t==true)window.location.reload();</script>";
this.Page.RegisterStartupScript("", script);
}
else if (commandName == "Relation")
{
string str4 = "<script>var t=window.showModalDialog('../../DesktopModules/RelationFlowCase/RelationFlowCase.aspx?CASENO=" + e.CommandArgument.ToString().Split(new char[] { '|' })[0] + "&MATERIALID=" + e.CommandArgument.ToString().Split(new char[] { '|' })[1] + "&FLG=1','','dialogHeight=600px;dialogWidth=800px;center=yes;resizable=yes;status=no;scroll=yes;help=no'); if(t==true)window.location.reload();</script>";
this.Page.RegisterStartupScript("", str4);
}
}
else
{
label.Text = Path.GetFileName(this.txtFilePath.Value);
button.Enabled = true;
}
}
}
} protected void BindDataGrid()
{
this.lblgrouphint.Text = "<font color=blue>批量上传步骤:1、<font color=orange>\"批量上传\"</font> 2、<font color=orange>\"浏览\"</font> 3、<font color=orange>\"上传\"</font> 4、<font color=orange>\"返回\"</font> 5、<font color=orange>\"刷新列表\"</font></font>";
this.VsFileType = ConfigurationManager.AppSettings["ftpFileType"];
this.VsCaseNo = base.Request.QueryString["CaseNo"];
if ((base.Request["ActiveID"] != null) && (base.Request.QueryString["ActiveID"].ToString().Length > 0))
{
this.VsActiveID = base.Request.QueryString["ActiveID"];
}
else
{
DBAccess access = new DBAccess();
string str = "select 流程ID from LANDFLOWGLOB where 案件编号='" + this.VsCaseNo + "'";
string str2 = access.GetFirstColumn(str).ToString();
str = "select 活动ID from FLOWNODE where 流程ID=" + str2 + " and 节点类型=1";
this.VsActiveID = access.GetFirstColumn(str).ToString();
}
this.VsUpFileType = base.Request.QueryString["UpFileType"];
if ((this.VsCaseNo == null) || (this.VsCaseNo == ""))
{
throw new ArgumentNullException("CaseNo");
}
if ((this.VsActiveID == null) || (this.VsActiveID == ""))
{
throw new ArgumentNullException("ActiveID");
}
if ((this.VsCaseNo == null) || (this.VsCaseNo == ""))
{
throw new ArgumentNullException("UpFileType");
}
string strConnection = ConfigurationManager.AppSettings["connecttingstring"].ToString();
string strDatabaseType = ConfigurationManager.AppSettings["DataServerType"].ToString();
DBAccess access2 = new DBAccess(strConnection, strDatabaseType);
string strSql = "select * from CASEMATERIALLIST where CASENO='" + this.VsCaseNo + "' and SIGNINFLAG='1'";
if (this.VsUpFileType.ToUpper() == "ONFLOW")
{
strSql = strSql + " and UPMATERIALTYPE='流程中上传'";
}
if (this.IsZH_CASEMATERIALLIST_Table())
{
strSql = strSql + " and DELETEFLAG=0";
}
string str6 = strSql;
strSql = str6 + " and (ActiveID like '" + this.VsActiveID + ",%' or ActiveID like '%," + this.VsActiveID + ",%' or ActiveID='" + this.VsActiveID + "' or ActiveID like '%," + this.VsActiveID + ",')";
DataSet dataSet = access2.GetDataSet(strSql);
this.DataGrid1.DataSource = dataSet.Tables[0].DefaultView;
this.DataGrid1.DataBind();
}
解决方案 »
- 网页的继续打印它的位置会慢慢变
- 动态生成excel时的问题
- 如何把所有的网页变黑灰色??
- [求助] 用DataList嵌套实现网页顶端菜单的动态数据绑定
- vs.net 2003开发的网站发布到windows2003系统上的问题请教
- 请问asp.net ajax控件updatepanel在无刷新提交时如何提示如“正在加载数据”?
- “水晶报表”数据显示问题!
- Ajax的ModalPopupExtender弹出页面问题?
- 50分,文件上传的事件响应问题!!
- 页面缓存禁用?
- GridView获取和设置单选按钮的问题。
- 怎么用JS判断CheckBoxList中选中项是相邻的 如果不是相邻项 保存的时候会给提示
你调试起来不是比我们在这看有快得多