Beispiel #1
0
 private void ShowInfo(int Id)
 {
     DNSABC.BLL.DNSABC_UserApi   bll   = new DNSABC.BLL.DNSABC_UserApi();
     DNSABC.Model.DNSABC_UserApi model = bll.GetModel(Id);
     this.lblId.Text     = model.Id.ToString();
     this.lblUserId.Text = model.UserId.ToString();
     this.lblIp.Text     = model.Ip;
     this.lblKEY.Text    = model.KEY;
 }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         DNSABC.BLL.DNSABC_UserApi bll = new DNSABC.BLL.DNSABC_UserApi();
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             int Id = (Convert.ToInt32(Request.Params["id"]));
             bll.Delete(Id);
             Response.Redirect("list.aspx");
         }
     }
 }
Beispiel #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtId.Text))
            {
                strErr += "编号格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtUserId.Text))
            {
                strErr += "关联编号格式错误!\\n";
            }
            if (this.txtIp.Text.Trim().Length == 0)
            {
                strErr += "授权IP不能为空!\\n";
            }
            if (this.txtKEY.Text.Trim().Length == 0)
            {
                strErr += "Key密钥不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    Id     = int.Parse(this.txtId.Text);
            int    UserId = int.Parse(this.txtUserId.Text);
            string Ip     = this.txtIp.Text;
            string KEY    = this.txtKEY.Text;

            DNSABC.Model.DNSABC_UserApi model = new DNSABC.Model.DNSABC_UserApi();
            model.Id     = Id;
            model.UserId = UserId;
            model.Ip     = Ip;
            model.KEY    = KEY;

            DNSABC.BLL.DNSABC_UserApi bll = new DNSABC.BLL.DNSABC_UserApi();
            bll.Add(model);
            ROYcms.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }