Пример #1
0
    protected void editGroup_Click(object sender, EventArgs e)
    {
        Regex re = new Regex(@"(http|https)://[^\s]*");

        if (txtGpName.Text.Trim().Equals(string.Empty))
        {
            Response.Write(JSHelper.ShowAlert("组织名称不能为空!"));
            return;
        }

        if (!re.IsMatch(txtGpLink.Text))
        {
            Response.Write(JSHelper.ShowAlert("请输入正确网址!"));
            return;
        }
        string link   = txtGpLink.Text;
        string imgUrl = Image1.ImageUrl;

        if (GroupHelper.Update(pageGp.GroupID, txtGpName.Text, dpl.SelectedValue, Image1.ImageUrl, txtGpLink.Text))
        {
            //Response.Write(JSHelper.ShowAlert("更改成功!"));
            Response.Redirect(Request.RawUrl);
        }
        else
        {
            Response.Write(JSHelper.ShowAlert("更改失败!(名字不能重复)"));
        }

        // Response.Redirect("groupEdit.aspx");
    }
        public ActionResult Update(int ID, string GroupName)
        {
            string token = Tools.GetToken();
            bool   x     = GroupHelper.Update(token, ID, GroupName);

            return(Content(x.ToString()));
        }