public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtProductID.Text)) { strErr += "产品ID格式错误!\\n"; } if (!PageValidate.IsNumber(txtisHost.Text)) { strErr += "主机个数 0表示主机个数不限制格式错误!\\n"; } if (!PageValidate.IsNumber(txtisTtl.Text)) { strErr += "TTL值 0表示TTL值不限制格式错误!\\n"; } if (!PageValidate.IsNumber(txtisMonitor.Text)) { strErr += "宕机检测个数 0表示无宕机检测功能格式错误!\\n"; } if (!PageValidate.IsNumber(txtisGroupID.Text)) { strErr += "NS组 表示默认开通的服务器组格式错误!\\n"; } if (this.txtRemark.Text.Trim().Length == 0) { strErr += "备注不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int Id = int.Parse(this.lblId.Text); int ProductID = int.Parse(this.txtProductID.Text); int isHost = int.Parse(this.txtisHost.Text); int isTtl = int.Parse(this.txtisTtl.Text); int isMonitor = int.Parse(this.txtisMonitor.Text); int isGroupID = int.Parse(this.txtisGroupID.Text); string Remark = this.txtRemark.Text; DNSABC.Model.DNSABC_ProductModelDns model = new DNSABC.Model.DNSABC_ProductModelDns(); model.Id = Id; model.ProductID = ProductID; model.isHost = isHost; model.isTtl = isTtl; model.isMonitor = isMonitor; model.isGroupID = isGroupID; model.Remark = Remark; DNSABC.BLL.DNSABC_ProductModelDns bll = new DNSABC.BLL.DNSABC_ProductModelDns(); bll.Update(model); ROYcms.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
private void ShowInfo(int Id) { DNSABC.BLL.DNSABC_ProductModelDns bll = new DNSABC.BLL.DNSABC_ProductModelDns(); DNSABC.Model.DNSABC_ProductModelDns model = bll.GetModel(Id); this.lblId.Text = model.Id.ToString(); this.lblProductID.Text = model.ProductID.ToString(); this.lblisHost.Text = model.isHost.ToString(); this.lblisTtl.Text = model.isTtl.ToString(); this.lblisMonitor.Text = model.isMonitor.ToString(); this.lblisGroupID.Text = model.isGroupID.ToString(); this.lblRemark.Text = model.Remark; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DNSABC.BLL.DNSABC_ProductModelDns bll = new DNSABC.BLL.DNSABC_ProductModelDns(); if (Request.Params["id"] != null && Request.Params["id"].Trim() != "") { int Id = (Convert.ToInt32(Request.Params["id"])); bll.Delete(Id); Response.Redirect("list.aspx"); } } }