




已阅读5页,还剩44页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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;/这个东西是后台必备的东西,创建类之类的public partial class Register : System.Web.UI.Page protected 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; /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; 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()内的 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()的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 System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using Camera;public partial class MyTemplateList : System.Web.UI.Page private Reltemplate rtmodel = new Reltemplate();/创建Reltemplate对象,有可能是你自己创建的,就是跟上面的User()类似的东西 protected void Page_Load(object sender, EventArgs e) if (!IsPostBack) BindMyTemplate();/创建BindMyTemplate对象,有可能是你自己创建的,就是跟上面的BindMyTemplate()类似的东西 private void BindMyTemplate() GridView1.DataSource = rtmodel.GetList( rt.cid=+Sessioncid.ToString();/Session是个传值的东西,如同qq私聊,具体网上查,Gridview1是前台的控件。Tostring()字符串,getlist不清楚 GridView1.DataBind();/绑定数据库 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)/没用过这个函数 if (e.CommandName = rtdel)/删除,好像是个按钮名字或ID为rtdel rtmodel.Delete(int.Parse(e.CommandArgument.ToString();/删除,有点看不懂 MessageBox.Show(this,删除成功!); BindMyTemplate(); Logins.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;public partial class Logins : System.Web.UI.Page public 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是他的值 case A:/A的时候 amodel = amodel.logins(TextBox1.Text, TextBox2.Text); /amodel应该是个函数传入ID为textbox1和textbox2的值 if (amodel != null) /amodel不为空的时候 Sessionadminid=amodel.Id;/把amodel.Id的值传到Session里 /Sessionatype = amodel.Admintype.Trim(); Response.Redirect(/AdminPage.aspx);/跳转到页面AdminPage.aspx else MessageBox.Show(this, 用户名或密码错误!); break; /下面B和C同理 case B: cmodel = cmodel.logins(TextBox1.Text, TextBox2.Text); if (cmodel != null) Sessioncid = cmodel.Id; / Sessionatype = amodel.Admintype.Trim(); Response.Redirect(/AdminPage.aspx); else MessageBox.Show(this, 用户名或密码错误!); break; case C: umodel = umodel.logins(TextBox1.Text, TextBox2.Text); if (umodel != null) Sessionuserid = umodel.Id; Response.Redirect(/Default.aspx); else MessageBox.Show(this, 用户名或密码错误!); break; /protected void Button2_Click(object sender, EventArgs e) / / Response.Redirect(/Register.aspx); / protected void Button2_Click(object sender, 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 System.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.Page protected void Page_Load(object sender, EventArgs e) ProductListD.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;public partial class ProductListD : System.Web.UI.Page private Cproduct cpmodel = new Cproduct();/创建同user() protected void Page_Load(object sender, EventArgs e) if (!IsPostBack)/第一次加载页面 BindProduct(); private void BindProduct() GridView1.DataSource = cpmodel.GetAllList();/读取cpmodel里面的值,没用过 GridView1.DataBind();/与数据库绑定 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) /没用过的函数又是,应该还是删除操作 if (e.CommandName = del1) cpmodel.Delete(Convert.ToInt32(e.CommandArgument.ToString(); MessageBox.Show(this, 删除成功!); BindProduct(); Default.aspx.csusing System;using System.Data;using System.Configuration;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 _Default : System.Web.UI.Page /有些东西已经说了,类似 private Cproduct cpmodel = new Cproduct(); protected void Page_Load(object sender, EventArgs e) if (!IsPostBack) BindProduct(); private void BindProduct() DataList2.DataSource = cpmodel.GetAllList( cp.cid in ( select cid from reltemplate ); DataList2.DataBind(); protected void DataList2_ItemCommand(object source, DataListCommandEventArgs e) /捕获DataList2的ItemCommand事件 if (e.CommandName = cpshow)/ItemCommand事件获得值若是cpshow(应该是个按钮) cpmodel = cpmodel.GetModel(int.Parse(e.CommandArgument.ToString();/类型转换,并传到GetModel()函数里 Response.Redirect(Tan.aspx?ttype=1&cid=+cpmodel.Cid.ToString();/跳转页面,就是显得牛b些,前面“”号里的混淆视线(地址栏里显示你打印的这些也有可能是安全性) Default2.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;public partial class Default2 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Default3.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;public partial class Default3 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Default4.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;public partial class Default4 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Tan.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;public partial class Tan : System.Web.UI.Page/这段代码比较设计东西较多,可以多问问编写的那个人 Reltemplate rtmodel = new Reltemplate();/创建对象 Ctemplate ctmodel = new Ctemplate();/创建对象 protected void Page_Load(object sender, EventArgs e) if (!IsPostBack) string ttype = Request.QueryString.Get(ttype);/获得值ttype(别的网页穿过来的,可以找跳转的那个语句Response.Redirect(Tan.aspx)传过来的) if (ttype = 1)/如果传过来的ttype值为1 DataSet ds = rtmodel.GetList( cid= + Request.QueryString.Get(cid);/创建虚拟的DataSet的ds存cid这个表,具体可以好好问问那个人 if (ds.Tables0.Rows.Count 0)/判断数据库非空时 int ctid = int.Parse(ds.Tables0.Rows0ctid.ToString();/不清楚 ctmodel = ctmodel.GetModel(ctid);/建立表模型获得ctmodel if (ctmodel.Ctname = 模板1)/值等于“模板1”时候 Response.Redirect(MyShop1.aspx?cid= + Request.QueryString.Get(cid) + &ctid= + ctid.ToString();/跳转页面 Else/不等于模板一时候 Response.Redirect(MyShop2.aspx?cid= + Request.QueryString.Get(cid) + &ctid= + ctid.ToString();/跳转页面 else/如果传过来的ttype值非1 /下面代码与上面代码类似 DataSet ds = rtmodel.GetList( cid= + Sessioncid.ToString(); if (ds.Tables0.Rows.Count 0) int ctid = int.Parse(ds.Tables0.Rows0ctid.ToString(); ctmodel = ctmodel.GetModel(ctid); if (ctmodel.Ctname = 模板1) Response.Redirect(MyShop1.aspx?cid= + Sessioncid.ToString() + &ctid= + ctid.ToString(); else Response.Redirect(MyShop2.aspx?cid= + Sessioncid.ToString() + &ctid= + ctid.ToString(); TemplateAdd.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;public partial class TemplateAdd : System.Web.UI.Page private Ctemplate ctmodel = new Ctemplate();/创建ctmodel函数 protected void Page_Load(object sender, EventArgs e) protected void btnok_Click(object sender, EventArgs e)/双击btnok按钮后的事件 string strErr = ; if (this.txtdiv1color.Text = )/ txtdiv1color的值为空时 strErr += 上,颜色不能为空!n;/strErr赋值 if (this.txtdiv1hight.Text = )/ txtdiv1hight的值为空时 strErr += 上,高度不能为空!n;/strErr赋值 if (this.txtdiv2color.Text = )/ txtdiv2color的值为空时 strErr += 左,颜色不能为空!n;/strErr赋值 if (this.txtdiv2width.Text = )/ txtdiv1hight的值为空时 strErr += 左,宽度不能为空!n;/strErr赋值 if (this.txtdiv3color.Text = )/ txtdiv3color的值为空时 strErr += 右,颜色不能为空!n;/strErr赋值 if (this.txtdiv3width.Text = )/ txtdiv3width的值为空时 strErr += 右,宽度度不能为空!n;/strErr赋值 if (strErr != )/strErr不为空时 MessageBox.Show(this, strErr); /弹出对话框,说白了就是上面的那些 return; if (int.Parse(txtdiv1hight.Text) 50) /将txtdiv1hight.Text值转化成整型让后判断是否大于50,int。parse是转化成整型的意思 MessageBox.Show(this,上,高度不能超过50%);/弹出对话框内容为“上,高度不能超过50%” return; if (int.Parse(txtdiv2width.Text) + int.Parse(txtdiv3width.Text) 98)/ txtdiv2width +txtdiv3width转化整型后加起来与98比 MessageBox.Show(this,左右宽度加起来不能大于100); return; if (RadioButtonList1.SelectedValue = 模板1)/单选按钮选中值为模板1是 if (int.Parse(txtdiv2width.Text) 50)/转成整型判断大小 MessageBox.Show(this,模板1的左宽度不能小于50%);/对话框内容“模板1的左宽度不能小于50%” return; if (RadioButtonList1.SelectedValue = 模板2)/单选按钮选中值为模板2时 if (int.Parse(txtdiv3width.Text) 0) /好像判断是受重复,.ischongfu()不清楚应该是自己创建的东西 MessageBox.Show(this, 用模板已存在!);/对话框 return; ctmodel.Add();/自己创建的函数add(),具体干什么不清楚 MessageBox.ShowAndRedirect(this, 添加成功!, TemplateAdd.aspx);/跳转加对话框,TemplateAdd.aspx为跳转页面 BusinessEdit.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;public partial class BusinessEdit : System.Web.UI.Page public Company cmodel = new Company();/创建cmodel函数 protected void Page_Load(object sender, EventArgs e) if (!IsPostBack)/页面第一次加载时 cmodel = cmodel.GetModel(int.Parse(Request.QueryString.Get(cid);/获得模型值cid的整型 if (cmodel != null)/cmodel非空时候,以下是赋
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025-2030中国木质家具行业市场深度调研及发展策略与风险研究报告
- 2025-2030中国智慧餐厅行业市场发展分析及前景预测与战略规划研究报告
- 基于机器学习的缺陷修复建议-洞察阐释
- 溶剂化改性颜料的性能提升及应用研究-洞察阐释
- 人教版小学二年级音乐教学计划
- 2025年监理工程师考试《建设工程目标控制(水利工程)》真题及答案
- 高品质图书馆阅读推广活动的心得体会
- 2025外科护理考核评价计划
- 环境问题的历史记忆-洞察阐释
- 五升六语文(专题)讲义-第16讲阅读专题之说明文的句段作用(教师版部编版含答案)
- 师带徒培训目标计划措施
- 人工智能助力企业创新发展
- 派出所民警培训课件
- 期中词性转换专练 2023-2024学年牛津上海版(试用本)八年级英语下册
- 室外埋地聚乙烯(PE)给水管道工程技术规程
- 医院培训课件:《ERAS在胃肠外科的应用》
- (新版)滑雪指导员技能理论考试复习题库(含答案)
- 脑动脉供血不足的护理查房
- 民法典介绍:解读中国民事法律体系的核心
- 解决多模穴流动不平衡问题之流道翻转技术
- 数据挖掘(第2版)全套教学课件
评论
0/150
提交评论