Asp.net源码专业站
首页->商务办公->PowerOA办公自动化系统商业源码>>AddressList/AddresslistModify.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:PowerOA办公自动化系统商业源码
当前文件:文件类型 PowerOA/AddressList/AddresslistModify.aspx.cs[4K,2009-6-12 11:52:10]打开代码结构图
普通视图
		            
1/************************************************************************************** 2作者:蒲丰. 3创建日期:2003-11-24 4修改者: 5修改日期: 6修改部分: 7类功能: 通讯录的修改功能.. 8****************************/ 9 10using System; 11using System.Collections; 12using System.ComponentModel; 13using System.Data; 14using System.Drawing; 15using System.Web; 16using System.Web.SessionState; 17using System.Web.UI; 18using System.Web.UI.WebControls; 19using System.Web.UI.HtmlControls; 20 21namespace OI.AddressList 22{ 23 /// <summary> 24 /// AddresslistModify 的摘要说明。 25 /// </summary> 26 public class AddresslistModify : OI.PageBase 27 { 28 protected System.Web.UI.WebControls.TextBox TextBoxCompany; 29 protected System.Web.UI.WebControls.TextBox TextBoxEmail; 30 protected System.Web.UI.WebControls.TextBox TextBoxTel; 31 protected System.Web.UI.WebControls.TextBox TextBoxAddress; 32 protected System.Web.UI.WebControls.DropDownList DropDownListsex; 33 protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; 34 protected System.Web.UI.WebControls.TextBox TextBoxReletioner; 35// int id; 36 protected System.Data .DataSet ds; 37 protected System.Web.UI.WebControls.ImageButton ImageButton1; 38 OI.DatabaseOper .DatabaseConnect Dbc=new OI.DatabaseOper.DatabaseConnect (); 39 private void Page_Load(object sender, System.EventArgs e) 40 { 41 // 在此处放置用户代码以初始化页面 42 if (Session["userid"]==null) 43 { 44 Response.Write ("<script>alert('超时,请重新登录');top.location.href='../userpass.aspx';</script>"); 45 return ; 46 } 47 if (!Page.IsPostBack ) 48 { 49 try 50 { 51 ViewState["id"]=int.Parse (Request.Params ["id"].ToString ()); 52 } 53 catch 54 { 55 return ; 56 } 57 CreateDataSource(); 58 } 59 } 60 Web 窗体设计器生成的代码 81 private void Button1_Click(object sender, System.EventArgs e) 82 { 83 84 } 85 private void CreateDataSource() 86 { 87 string str="select * from addresslist where ListID=" +ViewState["id"].ToString (); 88 ds=new DataSet (); 89 ds=Dbc.getBinding (str,"t"); 90 if (ds.Tables[0].Rows .Count >0) 91 { 92 DataRow dr=ds.Tables[0].Rows[0]; 93 TextBoxReletioner.Text =dr["Reletioner"].ToString (); 94 TextBoxAddress.Text =dr["Address"].ToString (); 95 TextBoxTel.Text =dr["Tel"].ToString (); 96 TextBoxEmail.Text =dr["Email"].ToString (); 97 TextBoxCompany.Text =dr["company"].ToString (); 98 if (dr["sex"].ToString ()=="True") 99 { 100 DropDownListsex.Items.FindByValue ("1").Selected =true; 101 } 102 else 103 { 104 DropDownListsex.Items.FindByValue ("0").Selected =true; 105 } 106 } 107 } 108 109 private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e) 110 { 111 string str ="select count(*) from AddressList where ListID !="+ViewState["id"].ToString() +" and Reletioner ='"+TextBoxReletioner.Text .Replace ("'","''") +"'"; 112 if (int.Parse (Dbc.GetValueBySql(str) )>0) 113 { 114 Page.RegisterStartupScript ("","<script>alert('这个联系人己经存在!')</script>"); 115 return ; 116 } 117 str = " update AddressList set Reletioner='"+TextBoxReletioner.Text.Replace ("'","''")+"',"; 118 str += "sex="+ DropDownListsex.SelectedValue+ ","; 119 str += "Address='"+TextBoxAddress.Text .Replace ("'","''")+"',"; 120 str += "Tel='"+TextBoxTel.Text+"',"; 121 str += "Email='"+TextBoxEmail.Text +"',"; 122 str += "Company='" +TextBoxCompany.Text.Replace ("'","''")+"',"; 123 str += "UserID=" + Session["userid"] ; 124 str += "where ListID ="+ViewState["id"].ToString (); 125 Dbc.ExecuteSQL (str); 126 Response.Redirect ("AddressList.aspx"); 127 } 128 } 129} 130
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:PowerOA办公自动化系统商业源码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146