系统所有代码翻译

上传人:ji****72 文档编号:39555309 上传时间:2018-05-17 格式:DOC 页数:49 大小:308KB
返回 下载 相关 举报
系统所有代码翻译_第1页
第1页 / 共49页
系统所有代码翻译_第2页
第2页 / 共49页
系统所有代码翻译_第3页
第3页 / 共49页
系统所有代码翻译_第4页
第4页 / 共49页
系统所有代码翻译_第5页
第5页 / 共49页
点击查看更多>>
资源描述

《系统所有代码翻译》由会员分享,可在线阅读,更多相关《系统所有代码翻译(49页珍藏版)》请在金锄头文库上搜索。

1、Register.aspx.csusing 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 Camera;/这个东西是后台必备的东西,创建类之类

2、的public partial class Register : System.Web.UI.Pageprotected void Page_Load(object sender, EventArgs e)/双击空白页面出现的控件protected void btnAdd_Click(object sender, EventArgs e)/btnAdd按钮时间,双击ID为btnAdd的那个按钮string strErr = “;/定义空字符串if (this.txtUserName.Text = “)/如果ID为txtUserName内容为空时(验证)strErr += “用户名不能为空!n“

3、; /ID为strErr的值输出“用户名不能为空!n”n是回车,前边那个是区分的,不懂可看语法if (this.txtPassword.Text = “)/密码为空判断strErr += “密码不能为空!n“;if (strErr != “)/不为空的时候MessageBox.Show(this, strErr);/弹出对话框显示strErr的内容return;string UserName = this.txtUserName.Text;string Password = this.txtPassword.Text;string sex = this.txtsex.SelectedValue

4、;string Address = this.txtAddress.Text;string Email = this.txtEmail.Text;string Phone = this.txtphone.Text;string realname =txtrealname.Text;/赋值把页面上对应的文本框所输入的内容(。text)赋值到自己定义的字段中User u = new User();/创建User()函数,就是你自己定义的,里面应该有public void user()。类似的函数,里面的属性用点(。)调用if (u.ischongfu(UserName) 0)/ User()内的

5、ischongfu(UserName)子函数,UserName为传递值MessageBox.Show(this,“用户名已存在!“);/对话框return;u.Realname = realname;u.Createdate = DateTime.Now;u.UserName = UserName;u.Password = Password;u.Sex = sex;u.Address = Address;u.Email = Email;u.Phone = Phone;/赋值如realname可以在User()函数里找到字段,DateTime.Now显示当前时间u.Add();/调用User()

6、的Add()方法MessageBox.ShowAndRedirect(this, “注册成功!,请登录!“, “Logins.aspx“);/对话框并跳转到“Logins.aspx“页面MyTemplateList.aspx.csusing 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 S

7、ystem.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using Camera;public partial class MyTemplateList : System.Web.UI.Pageprivate Reltemplate rtmodel = new Reltemplate();/创建Reltemplate对象,有可能是你自己创建的,就是跟上面的User()类似的东西protected void Page_Load(object sender, EventArgs e)if (!IsPostBack)Bin

8、dMyTemplate();BindMyTemplate();/创建BindMyTemplateBindMyTemplate对象,有可能是你自己创建的,就是跟上面的BindMyTemplateBindMyTemplate()类似的东西privateprivate voidvoid BindMyTemplate()BindMyTemplate()GridView1.DataSource = rtmodel.GetList(“ rt.cid=“+Session“cid“.ToString();/Session是个传值的东西,如同qq私聊,具体网上查,Gridview1是前台的控件。Tostring

9、()字符串,getlist不清楚GridView1.DataBind();/绑定数据库protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)/没用过这个函数if (e.CommandName = “rtdel“)/删除,好像是个按钮名字或ID为rtdelrtmodel.Delete(int.Parse(e.CommandArgument.ToString();/删除,有点看不懂MessageBox.Show(this,“删除成功!“);BindMyTemplate();Logins.aspx.

10、csusing 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 Camera;public partial class Logins : Sys

11、tem.Web.UI.Pagepublic Admin amodel = new Admin();public Company cmodel = new Company();public User umodel = new User();/创建函数类似user()protected void Page_Load(object sender, EventArgs e)protected void Button1_Click(object sender, EventArgs e)switch (RadioButtonList1.SelectedValue)单选按钮(小圆点)选中那个值,ABC是他的

12、值case “A“:/A的时候amodel = amodel.logins(TextBox1.Text, TextBox2.Text); /amodel应该是个函数传入ID为textbox1和textbox2的值if (amodel != null) /amodel不为空的时候Session“adminid“=amodel.Id;/把amodel.Id的值传到Session里/Session“atype“ = amodel.Admintype.Trim();Response.Redirect(“/AdminPage.aspx“);/跳转到页面AdminPage.aspxelseMessageB

13、ox.Show(this, “用户名或密码错误!“);break;/下面B和C同理 case “B“:cmodel = cmodel.logins(TextBox1.Text, TextBox2.Text);if (cmodel != null)Session“cid“ = cmodel.Id;/ Session“atype“ = amodel.Admintype.Trim();Response.Redirect(“/AdminPage.aspx“);elseMessageBox.Show(this, “用户名或密码错误!“);break;case “C“:umodel = umodel.lo

14、gins(TextBox1.Text, TextBox2.Text);if (umodel != null)Session“userid“ = umodel.Id;Response.Redirect(“/Default.aspx“);elseMessageBox.Show(this, “用户名或密码错误!“);break;/protected void Button2_Click(object sender, EventArgs e)/ Response.Redirect(“/Register.aspx“);/protected void Button2_Click(object sender

15、, EventArgs e)/双击botton2后跳转页面Response.Redirect(“/BusinessAdd.aspx“);protected void Button3_Click(object sender, EventArgs e) /双击botton3后跳转页面Response.Redirect(“/Register.aspx“);AdminPage.aspx.csusing System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using S

16、ystem.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class AdminPage : System.Web.UI.Pageprotected void Page_Load(object sender, EventArgs e)ProductListD.aspx.csusing System;using System.Data;using System.Configuration;using System.Col

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号