您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->唐唐企业管理网站源码>>Manager/EditerMessage.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:唐唐企业管理网站源码
当前文件:文件类型 TangCompany/Manager/EditerMessage.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using System.Data.SqlClient; 12 13public partial class Manager_EditerMessage : System.Web.UI.Page 14{ 15 protected void Page_Load(object sender, EventArgs e) 16 { 17 18 } 19 protected void BindMessage() { 20 21 string nId = string.Empty; 22 if(Request.QueryString["Id"]!=null){ 23 24 nId = Request.QueryString["Id"].ToString(); 25 26 } 27 SqlParameter[] paras ={ new SqlParameter("Id", SqlDbType.Int, 4) }; 28 paras[0].Value = nId; 29 FormViewMessage.DataSource = SqlHelper.ExcuteReadApdater("sys_ByIdSelectMessage", CommandType.StoredProcedure, paras); 30 FormViewMessage.DataBind(); 31 32 } 33 protected string IsSex(string isBool) { 34 35 string txtSex = string.Empty; 36 if (isBool.ToLower() == "true") 37 { 38 39 txtSex = "男孩"; 40 41 } 42 else { 43 44 txtSex = "女孩"; 45 46 } 47 return txtSex; 48 49 } 50 protected string IsBool(string isBool) { 51 52 string txtBool = string.Empty; 53 if (isBool.ToLower() == "true") 54 { 55 56 txtBool = "1"; 57 58 } 59 else { 60 61 txtBool = "0"; 62 63 } 64 return txtBool; 65 66 } 67 protected void ButtonUpdate_Click(object sender, EventArgs e) 68 { 69 string nId = Request.QueryString["Id"].ToString(); 70 string txtName = ((TextBox)FormViewMessage.FindControl("TextBoxName")).Text; 71 string txtSex = ((TextBox)FormViewMessage.FindControl("TextBoxSex")).Text; 72 string txtEmxil = ((TextBox)FormViewMessage.FindControl("TextBoxEmail")).Text; 73 string txtQQ = ((TextBox)FormViewMessage.FindControl("TextBoxQQ")).Text; 74 string txtHiden = ((DropDownList)FormViewMessage.FindControl("TextBoxHidden")).SelectedValue; 75 string txtSelect = ((DropDownList)FormViewMessage.FindControl("SelectVis")).SelectedValue; 76 string txtHomePage = ((TextBox)FormViewMessage.FindControl("TextBoxHomePage")).Text; 77 string txtContent = ((TextBox)FormViewMessage.FindControl("TextBoxContent")).Text; 78 SqlParameter[] paras ={ new SqlParameter("Id",SqlDbType.Int,4), 79 new SqlParameter("@Name",SqlDbType.NVarChar,30), 80 new SqlParameter("@Sex",SqlDbType.Bit), 81 new SqlParameter("@Email",SqlDbType.NVarChar,50), 82 new SqlParameter("@QQ",SqlDbType.BigInt,8), 83 new SqlParameter("@HomePage",SqlDbType.NVarChar,50), 84 new SqlParameter("@Content",SqlDbType.NVarChar,200), 85 new SqlParameter("@Types",SqlDbType.Bit), 86 new SqlParameter("@Vis",SqlDbType.Bit), 87 88 }; 89 paras[0].Value = nId; 90 paras[1].Value = txtName; 91 paras[2].Value = txtSex; 92 paras[3].Value = txtEmxil; 93 paras[4].Value = txtQQ; 94 paras[5].Value = txtHiden; 95 paras[6].Value = txtSelect; 96 paras[7].Value = txtHomePage; 97 paras[8].Value = txtContent; 98 99 SqlHelper.ExcuteNonQurey("UPDATE [Message] SET Name=@Name,Sex=@Sex,Email=@Email,QQ=@QQ,HomePage=@HomePage,Content=@Content,Types=@Types,Vis=@Vis WHERE Id=@Id", CommandType.Text, paras); 100 BindMessage(); 101 Response.Redirect("Message.aspx"); 102 } 103} 104
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:唐唐企业管理网站源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号