protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtGradeName.Text.Trim().Length == 0) { strErr += "等级名称不能为空!\\n"; } if (!PageValidate.IsNumber(txtisOrder.Text)) { strErr += "权重格式错误!\\n"; } if (this.txtRemark.Text.Trim().Length == 0) { strErr += "备注不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string GradeName = this.txtGradeName.Text; int isOrder = int.Parse(this.txtisOrder.Text); string Remark = this.txtRemark.Text; DNSABC.Model.DNSABC_UserGrade model = new DNSABC.Model.DNSABC_UserGrade(); model.GradeName = GradeName; model.isOrder = isOrder; model.Remark = Remark; DNSABC.BLL.DNSABC_UserGrade bll = new DNSABC.BLL.DNSABC_UserGrade(); bll.Add(model); ROYcms.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
private void ShowInfo(int Id) { DNSABC.BLL.DNSABC_UserGrade bll = new DNSABC.BLL.DNSABC_UserGrade(); DNSABC.Model.DNSABC_UserGrade model = bll.GetModel(Id); this.lblId.Text = model.Id.ToString(); this.lblGradeName.Text = model.GradeName; this.lblisOrder.Text = model.isOrder.ToString(); this.lblRemark.Text = model.Remark; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DNSABC.BLL.DNSABC_UserGrade bll = new DNSABC.BLL.DNSABC_UserGrade(); if (Request.Params["id"] != null && Request.Params["id"].Trim() != "") { int Id = (Convert.ToInt32(Request.Params["id"])); bll.Delete(Id); Response.Redirect("list.aspx"); } } }