private void ShowInfo(int parentid) { ncu.mao.BLL.t_privilege bll = new ncu.mao.BLL.t_privilege(); ncu.mao.Model.t_privilege model = bll.GetModel(parentid); this.lblprivilegeid.Text = model.privilegeid.ToString(); this.txtprivilegename.Text = model.privilegename; this.txtdiscription.Text = model.discription; this.txturl.Text = model.url; this.chkflag.Checked = model.flag; this.lblparentid.Text = model.parentid.ToString(); }
private void ShowInfo(int parentid) { ncu.mao.BLL.t_privilege bll = new ncu.mao.BLL.t_privilege(); ncu.mao.Model.t_privilege model = bll.GetModel(parentid); this.lblprivilegeid.Text = model.privilegeid.ToString(); this.lblprivilegename.Text = model.privilegename; this.lbldiscription.Text = model.discription; this.lblurl.Text = model.url; this.lblflag.Text = model.flag?"是":"否"; this.lblparentid.Text = model.parentid.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ncu.mao.BLL.t_privilege bll = new ncu.mao.BLL.t_privilege(); if (Request.Params["id"] != null && Request.Params["id"].Trim() != "") { int parentid = (Convert.ToInt32(Request.Params["id"])); bll.Delete(parentid); } } }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtprivilegeid.Text)) { strErr += "privilegeid格式错误!\\n"; } if (this.txtprivilegename.Text.Trim().Length == 0) { strErr += "privilegename不能为空!\\n"; } if (this.txtdiscription.Text.Trim().Length == 0) { strErr += "discription不能为空!\\n"; } if (this.txturl.Text.Trim().Length == 0) { strErr += "url不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int privilegeid = int.Parse(this.txtprivilegeid.Text); string privilegename = this.txtprivilegename.Text; string discription = this.txtdiscription.Text; string url = this.txturl.Text; bool flag = this.chkflag.Checked; ncu.mao.Model.t_privilege model = new ncu.mao.Model.t_privilege(); model.privilegeid = privilegeid; model.privilegename = privilegename; model.discription = discription; model.url = url; model.flag = flag; ncu.mao.BLL.t_privilege bll = new ncu.mao.BLL.t_privilege(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }