protected void BtnSubmit_OnClick(object sender, EventArgs e)
        {
            var Account  = this.txtAccount.Text.Trim();
            var Password = this.txtPassword.Text.Trim();
            var NickName = this.txtNickName.Text.Trim();
            var RolesId  = this.txtRolesId.Text.Trim();

            Model917.Users user = new Model917.Users()
            {
                Id             = Guid.Parse(this.txtId.Text),
                Users_Account  = Account,
                Users_Password = Password,
                Users_NickName = NickName,
                Users_RolesId  = Guid.Parse(RolesId)
            };
            var res = usersSvc.EditUsers(user);

            if (res > 0)
            {
                Response.Write("<script>alert('修改成功');location.href='Users_List.aspx'</script>");
            }
            else
            {
                Response.Write("<script>alert('修改失败');location.href='Users_List.aspx'</script>");
            }
        }
Exemple #2
0
        protected void BtnSubmit_OnClick(object sender, EventArgs e)
        {
            UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
            var file = UploadImage(FileUpload1, "../../upload/users/");

            Model917.Users users = new Model917.Users()
            {
                Users_Account  = this.txtAccount.Text.Trim(),
                Users_Password = this.txtPassword.Text.Trim(),
                Users_NickName = this.txtNickName.Text.Trim(),
                Users_RolesId  = Guid.Parse(this.ddlRolesList.SelectedValue),
                Users_Photo    = (file == null ? "def.png" : file)
            };
            Response.Write("<script>alert('" + file + "')</script>");
            var res = usersSvc.AddUsers(users);

            if (res > 0)
            {
                Response.Write("<script>alert('添加成功');location.href='Users_List.aspx'</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败');location.href='Users_List.aspx'</script>");
            }
        }