Exemple #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtUserID.Text))
            {
                strErr += "UserID格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtRoleID.Text))
            {
                strErr += "RoleID格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int UserID = int.Parse(this.txtUserID.Text);
            int RoleID = int.Parse(this.txtRoleID.Text);

            zs.Model.Sys_UserRole model = new zs.Model.Sys_UserRole();
            model.UserID = UserID;
            model.RoleID = RoleID;

            zs.BLL.Sys_UserRole bll = new zs.BLL.Sys_UserRole();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Exemple #2
0
 private void ShowInfo(int ID)
 {
     zs.BLL.Sys_UserRole   bll   = new zs.BLL.Sys_UserRole();
     zs.Model.Sys_UserRole model = bll.GetModel(ID);
     this.lblID.Text     = model.ID.ToString();
     this.txtUserID.Text = model.UserID.ToString();
     this.txtRoleID.Text = model.RoleID.ToString();
 }