Exemplo n.º 1
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            string strId = editid.Text.Trim();

            try
            {
                Guid id = new Guid(strId);
                SYCRM.BLL.Area BF = new SYCRM.BLL.Area();
                SYCRM.Model.Area MF = new SYCRM.Model.Area();
                MF = BF.GetModel(id);

                List<SYCRM.Model.Area> listMA = BF.GetModelList("WBS like '%" + MF.WBS + "%'");

                foreach (SYCRM.Model.Area a in listMA)
                {
                    BF.Delete(a.Id);
                }
                Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "删除成功!", "<script>alert('删除成功!');window.location.href='Area.aspx'</script>");
            }
            catch
            {
                Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "删除失败!", "<script>alert('删除失败!');window.location.href='Area.aspx'</script>");
            }
        }