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

            if (!PageValidate.IsNumber(txtUserId.Text))
            {
                strErr += "UserId格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtUserGroupId.Text))
            {
                strErr += "UserGroupId格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int UserId      = int.Parse(this.txtUserId.Text);
            int UserGroupId = int.Parse(this.txtUserGroupId.Text);

            Bsam.Core.Model.Models.Model.Sys_User_In_Group model = new Bsam.Core.Model.Models.Model.Sys_User_In_Group();
            model.UserId      = UserId;
            model.UserGroupId = UserGroupId;

            Bsam.Core.Model.Models.BLL.Sys_User_In_Group bll = new Bsam.Core.Model.Models.BLL.Sys_User_In_Group();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
示例#2
0
 private void ShowInfo()
 {
     Bsam.Core.Model.Models.BLL.Sys_User_In_Group   bll   = new Bsam.Core.Model.Models.BLL.Sys_User_In_Group();
     Bsam.Core.Model.Models.Model.Sys_User_In_Group model = bll.GetModel();
     this.txtUserId.Text      = model.UserId.ToString();
     this.txtUserGroupId.Text = model.UserGroupId.ToString();
 }