/// <summary> /// 增加一条数据 /// </summary> public int Add(rr2.Model.userInfo model) { if (model.userLoginName != "" & model.userTrueName != "" & model.userPass != "" & model.userEmail != "" & model.userTel != "") { return(new rr2.DAL.userInfo().Add(model)); } else { return(0); } //return dal.Add(model); }
protected void Button1_Click(object sender, EventArgs e) { rr2.Model.userInfo curuser = new rr2.Model.userInfo(); curuser.userLoginName = TBusername.Text; curuser.userTrueName = TBuserTrue.Text; curuser.userPass = TBuserpwd.Text; curuser.userEmail = TBuserEmail.Text; curuser.userTel = TBuserTel.Text; curuser.flag = int.Parse(DropDownList1.SelectedValue); int jg = new rr2.BLL.userInfo().Add(curuser); if (jg == 0) { LabelResule.Text = "添加失败,请检查数据完整性"; } else { LabelResule.Text = "添加成功!!"; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(rr2.Model.userInfo model) { return(dal.Update(model)); }