예제 #1
0
        protected void BtnSubmit_OnClick(object sender, EventArgs e)
        {
            UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
            Model917.FriendShips friendShips = new Model917.FriendShips()
            {
                FriendShips_Title = this.txtTitle.Text.Trim(),
                FriendShips_Link  = this.txtLink.Text.Trim(),
            };
            var res = friendShipsService.AddFriendShips(friendShips);

            if (res > 0)
            {
                Response.Write("<script>alert('添加成功');location.href='FriendShips_List.aspx'</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败');location.href='FriendShips_List.aspx'</script>");
            }
        }
예제 #2
0
        protected void BtnSubmit_OnClick(object sender, EventArgs e)
        {
            var Title = this.txtTitle.Text.Trim();
            var Link  = this.txtLink.Text.Trim();

            Model917.FriendShips friendShips = new Model917.FriendShips()
            {
                Id = Guid.Parse(this.txtId.Text),
                FriendShips_Title = Title,
                FriendShips_Link  = Link
            };
            var res = friendShipsService.EditFriendShips(friendShips);

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