protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtusercode.Text.Trim().Length == 0) { strErr += "usercode不能为空!\\n"; } if (this.txtuseraddr.Text.Trim().Length == 0) { strErr += "useraddr不能为空!\\n"; } if (this.txtopertype.Text.Trim().Length == 0) { strErr += "opertype不能为空!\\n"; } if (this.txtoperobject.Text.Trim().Length == 0) { strErr += "operobject不能为空!\\n"; } if (this.txtopervalue.Text.Trim().Length == 0) { strErr += "opervalue不能为空!\\n"; } if (this.txtoperdesc.Text.Trim().Length == 0) { strErr += "operdesc不能为空!\\n"; } if (this.txtopertime.Text.Trim().Length == 0) { strErr += "opertime不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string usercode = this.txtusercode.Text; string useraddr = this.txtuseraddr.Text; string opertype = this.txtopertype.Text; string operobject = this.txtoperobject.Text; string opervalue = this.txtopervalue.Text; string operdesc = this.txtoperdesc.Text; string opertime = this.txtopertime.Text; Jium.Model.userlog model = new Jium.Model.userlog(); model.usercode = usercode; model.useraddr = useraddr; model.opertype = opertype; model.operobject = operobject; model.opervalue = opervalue; model.operdesc = operdesc; model.opertime = opertime; Jium.BLL.userlog bll = new Jium.BLL.userlog(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Jium.BLL.userlog bll = new Jium.BLL.userlog(); if (Request.Params["id"] != null && Request.Params["id"].Trim() != "") { long id = (Convert.ToInt64(Request.Params["id"])); bll.Delete(id); Response.Redirect("list.aspx"); } } }
private void ShowInfo(long id) { Jium.BLL.userlog bll = new Jium.BLL.userlog(); Jium.Model.userlog model = bll.GetModel(id); this.lblid.Text = model.id.ToString(); this.lblusercode.Text = model.usercode; this.lbluseraddr.Text = model.useraddr; this.lblopertype.Text = model.opertype; this.lbloperobject.Text = model.operobject; this.lblopervalue.Text = model.opervalue; this.lbloperdesc.Text = model.operdesc; this.lblopertime.Text = model.opertime; }