📄 第六章 用户权限管理(七) -- c#读写数据库image字段_宪华_新浪博客.htm
字号:
href="http://uni.sina.com.cn/c.php?t=blog&k=%B9%A4%D7%F7%C1%F7&ts=bpost&stype=tag"
target=_blank>工作流</A><WBR> <A class=tag
href="http://uni.sina.com.cn/c.php?t=blog&k=%B5%E7%D7%D3%D5%FE%CE%F1%CF%B5%CD%B3&ts=bpost&stype=tag"
target=_blank>电子政务系统</A><WBR> <A class=tag
href="http://uni.sina.com.cn/c.php?t=blog&k=it&ts=bpost&stype=tag"
target=_blank>it</A><WBR> </TD>
<TD vAlign=top align=right width=250>分类:<A
href="http://blog.sina.com.cn/s/articlelist_1596986490_1_1.html">基于工作流的政务系统--实现</A></TD></TR></TBODY></TABLE></DIV>
<DIV class=articleContent id=articleBody>
<P><FONT style="FONT-SIZE: 16px"><STRONG>6.6 角色用户管理设计与实现</STRONG></FONT></P>
<P><STRONG>6.6.4 员工信息管理</STRONG></P>
<P><STRONG>Employees.aspx.cs文件代码:</STRONG></P>
<P align=center><STRONG><A
href="http://photo.blog.sina.com.cn/showpic.html#blogid=5f30147a0100dkxs&url=http://static7.photo.sina.com.cn/orignal/5f30147at6807cf01ef56"
target=_blank><IMG style="MAX-WIDTH: 500px"
src="第六章%20用户权限管理(七)%20--%20C%23读写数据库Image字段_宪华_新浪博客_files/5f30147at6807cf01ef56.gif"></A></STRONG></P>
<P align=center>图6.23 DataGrid事件处理函数</P>
<P align=center> <WBR></P>
<P align=left> <WBR> <WBR> <WBR> using
System.IO;<BR> <WBR> <WBR> <WBR> using
System.Configuration;<BR> <WBR> <WBR> <WBR> using
System.Text.RegularExpressions;<BR> <WBR> <WBR> <WBR> using
DataAccess;</P>
<P align=left> <WBR> <WBR> <WBR> ......</P>
<P align=left> <WBR> <WBR> <WBR> namespace
workflow.admin<BR> <WBR> <WBR> <WBR>
{<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> public
class EmployeesManagement :
System.Web.UI.Page<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
{<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>protected
System.Web.UI.WebControls.DataGrid
DataGrid1;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.TextBox
TextBox1;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.Label
Label1;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.Button
Button1;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.TextBox
TextBox2;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.TextBox
TextBox3;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.TextBox
TextBox4;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.TextBox
TextBox5;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.TextBox
TextBox6;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.TextBox
TextBox7;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.HtmlControls.HtmlInputFile
PersonImage;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.TextBox
TextBox8;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.DropDownList
DropDownList1;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.HtmlControls.HtmlGenericControl
Message;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.RadioButton
RadioButton1;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.RadioButton
RadioButton2;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.Label
Label2;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.Label
Label3;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.Button
Button2;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.TextBox
TextBox9;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.WebControls.Button
Button3;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected System.Web.UI.HtmlControls.HtmlGenericControl
EditMessage; <WBR> <WBR><BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
private void Page_Load(object sender, System.EventArgs
e)<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
{<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
if(!
IsPostBack)<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
{<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
//验证用户是否登录<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
if(Session["userid"] ==
null)<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
Response.Redirect("./Message.aspx");</P>
<P
align=left> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
ViewState["datagridsource"]="";<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
ViewState["listsource"]="";<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
string strSql="select Group_Name,Group_ID from
organization";<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
DataSet ds=new
Base().SQLExeDataSet(strSql); <WBR> <WBR> <WBR> <WBR><BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
if(ds
!=null)<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
{<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
DataRow
myDataRow=ds.Tables[0].NewRow();<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
ds.Tables[0].Rows.InsertAt(myDataRow,0);<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
ViewState["listsource"]=ds;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
}<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>BindOrganizationList();<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
BindGrid();<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
}<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
primarystatus();//置空编辑控件<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
}</P>
<P
align=left> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
void
primarystatus()<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
{<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
Message.InnerHtml="";<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
<WBR>EditMessage.InnerText="";<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
Label1.Text="";<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
Label2.Text="";<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
Label3.Text="";<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
Button1.Visible=true;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
Button2.Visible=false;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
Button3.Visible=false;</P>
<P
align=left> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
}</P>
<P
align=left> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
//设置DataGrid图片按钮的url地址</P>
<P
align=left> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
protected string FormatURL(string
arg)<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
{<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>return
"DisplayImage.aspx?id="+arg;<BR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
}</P>
<P
align=left> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR> <WBR>
void
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -