当前位置: 首页 > news >正文

手机版网站原理哈尔滨房产信息网官网

手机版网站原理,哈尔滨房产信息网官网,网页制作公司找哪家,进行网站开发前 需要干什么效果图 点击新增按钮 点击添加 添加成功展示新增数据 点击删除#xff0c;出现删除选项#xff0c;点击确定根据id删除成功 成功删除 实现过程 Model设置具体流程在下面链接中 https://blog.csdn.net/Mr_wangzu/article/details/136805824?spm1001.2014.3001.5501 DAL …效果图  点击新增按钮 点击添加  添加成功展示新增数据  点击删除出现删除选项点击确定根据id删除成功  成功删除  实现过程 Model设置具体流程在下面链接中 https://blog.csdn.net/Mr_wangzu/article/details/136805824?spm1001.2014.3001.5501 DAL using System; using System.Collections.Generic; using System.Linq; using System.Web; using WebApplication1.Models;namespace WebApplication1.DAL {public class CustomersDBService{public static ListCustomer Show(){CustomersDBEntities db new CustomersDBEntities();return db.Customers.ToList();}public static bool Add(Customer cu) {CustomersDBEntities db new CustomersDBEntities();db.Customers.Add(cu);return db.SaveChanges()0;}public static bool shan(int id) {CustomersDBEntities db new CustomersDBEntities();Customer model new Customer();model.CID id;db.Entry(model).State System.Data.EntityState.Deleted;db.Customers.Remove(model);return db.SaveChanges()0;}} } BLL using System; using System.Collections.Generic; using System.Linq; using System.Web; using WebApplication1.Models; namespace WebApplication1.BLL {public class CustomersDBManger{public static ListCustomer Show() {return DAL.CustomersDBService.Show();}public static bool Add(Customer cu) {return DAL.CustomersDBService.Add(cu);}public static bool shan(int id) {return DAL.CustomersDBService.shan(id);}} } WebForm1.aspx 前端部分 % Page LanguageC# AutoEventWireuptrue CodeBehindWebForm1.aspx.cs InheritsWebApplication1.WebForm1 %!DOCTYPE htmlhtml xmlnshttp://www.w3.org/1999/xhtml head runatserver meta http-equivContent-Type contenttext/html; charsetutf-8/title/titlestyle typetext/css.auto-style1 {height: 25px;}/style /head bodyform idform1 runatserverdivtable border1trtd编号/tdtd客户名/tdtd性别/tdtd生日/tdtd电话/tdtd邮件/tdtd操作/td/trasp:Repeater IDRepeater1 runatserver OnItemCommandRepeater1_ItemCommandItemTemplatetrtd%#Eval(CID) %/tdtd%#Eval(CName) %/tdtd%#Eval(CGender) %/td td%#Eval(CBirthday) %/tdtd%#Eval(CTel) %/tdtd%#Eval(CEmail) %/tdtda hrefWebForm2.aspx新增/a asp:LinkButton IDLinkButton1 runatserver CommandArgument%#Eval(CID) % CommandNamedel onClientClickreturn confirm(确定删除); 删除/asp:LinkButton/td/tr/ItemTemplate/asp:Repeater/table/div/form /body /html后端部分 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using WebApplication1.Models; namespace WebApplication1 {public partial class WebForm1 : System.Web.UI.Page{protected void Page_Load(object sender, EventArgs e){Repeater1.DataSource BLL.CustomersDBManger.Show();Repeater1.DataBind();}protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e){int id Convert.ToInt32(e.CommandArgument);if (e.CommandNamedel){bool sta BLL.CustomersDBManger.shan(id);string st sta true ? 成功 : 失败;ClientScript.RegisterStartupScript(this.GetType(),alert,alert(成功),true);Repeater1.DataSource BLL.CustomersDBManger.Show();Repeater1.DataBind();}}} } WebForm2.aspx 前端部分 % Page LanguageC# AutoEventWireuptrue CodeBehindWebForm2.aspx.cs InheritsWebApplication1.WebForm2 %!DOCTYPE htmlhtml xmlnshttp://www.w3.org/1999/xhtml head runatserver meta http-equivContent-Type contenttext/html; charsetutf-8/title/title /head bodya hrefWebForm1.aspx返回/aform idform1 runatserverdivasp:Label IDLabel1 runatserver Text姓名/asp:Labelasp:TextBox IDTextBox1 runatserver/asp:TextBoxbr / asp:Label IDLabel5 runatserver Text性别/asp:Label asp:DropDownList IDDropDownList1 runatserverasp:ListItem男/asp:ListItemasp:ListItem女/asp:ListItem/asp:DropDownListbr / asp:Label IDLabel2 runatserver Text生日/asp:Labelasp:TextBox IDTextBox2 runatserver/asp:TextBoxbr / asp:Label IDLabel3 runatserver Text电话/asp:Labelasp:TextBox IDTextBox3 runatserver/asp:TextBoxbr / asp:Label IDLabel4 runatserver Text邮箱/asp:Labelasp:TextBox IDTextBox4 runatserver/asp:TextBox/divasp:Button IDButton1 runatserver Text添加 OnClickButton1_Click //form /body /html后端部分 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using WebApplication1.Models; namespace WebApplication1 {public partial class WebForm2 : System.Web.UI.Page{protected void Page_Load(object sender, EventArgs e){}protected void Button1_Click(object sender, EventArgs e){try{if (TextBox1.Text ! DropDownList1.SelectedValue.ToString() ! ){Customer model new Customer();model.CName TextBox1.Text;model.CGender DropDownList1.SelectedValue.ToString();model.CBirthday DateTime.Parse(TextBox2.Text);model.CTel TextBox3.Text;model.CEmail TextBox4.Text;if (BLL.CustomersDBManger.Add(model)){ClientScript.RegisterStartupScript(this.GetType(), success, alert(正确添加),location.hrefWebForm1.aspx, true);}else{ClientScript.RegisterStartupScript(this.GetType(), fail, alert(错误), true);};}else{Response.Write(请完善);}}catch (Exception s){Console.WriteLine(s); }}} }
http://www.zqtcl.cn/news/80500/

相关文章:

  • 女人动漫做受网站wordpress首页调用文章页图片
  • 中英文双语企业网站wordpress模板开发 2016
  • 五力合一营销型网站建设系统带会员中心WordPress主题
  • 沧州做家装的公司网站正规app开发价格表
  • 亚马逊网站建设案例网站响应时间 标准
  • 做家电网站好做网站开发需要什么
  • 点击器网站优化查询代码
  • php可以做网站吗wordpress页面打不开
  • 建设地方美食网站的目的公司域名是什么意思
  • 北辰手机网站建设seo外贸推广
  • 潍坊市建设工程管理处网站淮南app
  • 什么网站可以找人做系统双桥集团网站建设
  • 厦门企业建站模板医院网站备案前置审批
  • 桌面网站怎么做商丘做手机做网站
  • 地方网站还有得做吗网站 前置审批
  • 百度做的网站google怎么做网站推广
  • 网站域名注册查询wordpress根目录在
  • 网站建设公司哪个好做发外链的网站排名
  • 象58同城网站建设需要多少钱怎样建设小游戏网站
  • 福田网站推广深圳西乡网站建设
  • wamp 做网站发布影视网站
  • 珠海移动网站建设费用微信商城在哪里进入
  • 百度站长工具是什么意思网络营销案例实例
  • 重庆网站建立网站优化seo是什么意思
  • 网站源码 正在建设中网站vip功能怎么实现
  • 网站开发文档源码直播类网站怎么做
  • 网站建设哪里学企业公司网
  • 网站策划知识翻页大图网站
  • 本地网站怎么建设线在科技成都网站推广公司
  • 大唐网站设计企业网站建设实训小结