Example #1
0
        protected void Merge_Click(object sender, EventArgs e)
        {
            long fromConId = 0; long toConId = 0;
            bool result = false;

            if (!string.IsNullOrEmpty(Request.Form["fromConId"]) && !string.IsNullOrEmpty(Request.Form["toConId"]))
            {
                if (long.TryParse(Request.Form["fromConId"], out fromConId) && long.TryParse(Request.Form["toConId"], out toConId))
                {
                    result = conBll.MergeContact(fromConId, toConId, LoginUserId, !string.IsNullOrEmpty(Request.Form["ckDel"]) && Request.Form["ckDel"] == "on");
                }
            }
            ClientScript.RegisterStartupScript(this.GetType(), "提示信息", $"<script>alert('保存{(result ? "成功" : "失败")}!');</script>");
            if (result)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "页面重载", $"<script>location.href='../SysSetting/MergeContact?fromConId={fromConId.ToString()}&toConId={toConId.ToString()}';</script>");
            }
        }