Exemplo n.º 1
0
        /// <summary>
        /// 删除分类
        /// </summary>
        private void DelType()
        {
            string ename = F("moduleName");
            string infoId = F("infoid");
            long parmentId = L("parmentId");

            int i = 0;
            int j = 0;
            XYECOM.Business.XYClass xy = new XYECOM.Business.XYClass();

            if (ename.Equals("job") || ename.Equals("exhibition"))
            {
                if (ename.Equals("job"))
                {
                    XYECOM.Business.Post post = new Post();
                    j = xy.InfoNum("i_engageinfo", "P_ID", infoId);
                    if (j <= 0)
                    {
                        i = post.Delete(infoId);
                    }
                }
                else if (ename.Equals("exhibition"))
                {
                    XYECOM.Business.ShowType showtype = new XYECOM.Business.ShowType(); ;
                    j = xy.InfoNum("XY_showinfo", "typeid", infoId);
                    if (j <= 0)
                    {
                        i = showtype.Delete(infoId);
                    }
                }

            }
            else
            {
                if (ename.Equals("offer") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("offer"))
                {
                    XYECOM.Business.ProductType pt = new XYECOM.Business.ProductType();
                    j = xy.InfoNum("i_supply", "PT_ID", infoId);
                    if (j <= 0)
                    {
                        i = pt.Delete(infoId);
                    }
                }
                else if (ename.Equals("investment") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("investment"))
                {
                    XYECOM.Business.InviteBusinessType it = new XYECOM.Business.InviteBusinessType();
                    j = xy.InfoNum("i_invitebusinessmaninfo", "IT_ID", infoId);
                    if (j <= 0)
                    {
                        i = it.Delete(infoId);
                    }
                }
                else if (ename.Equals("service") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("service"))
                {
                    XYECOM.Business.ServiceType st = new XYECOM.Business.ServiceType(); ;
                    j = xy.InfoNum("i_serviceinfo", "ST_ID", infoId);
                    if (j <= 0)
                    {
                        i = st.Delete(infoId);
                    }
                }

            }
            if (j > 0)
            {
                ResponseXML(Result.Failed, "该分类下含有信息!");
                return;
            }
            if (i > 0)
            {
                ResponseXML(Result.Success, "删除成功");
                return;
            }
        }
Exemplo n.º 2
0
    /// <summary>
    /// ɾ��
    /// </summary>
    /// <param name="id"></param>
    private void Del(String id)
    {
        int i = 0;
        int j = 0;
        XYECOM.Business.XYClass xy = new XYECOM.Business.XYClass();

        if (id.Contains(","))
        {
            id = id.Substring(0, (id.Length - 1));
        }
        if (isfirstid.Equals("") || !isfirstid.Equals(id))
        {

            if (ename.Equals("job") || ename.Equals("exhibition"))
            {
                if (ename.Equals("job"))
                {
                    XYECOM.Business.Post post = new Post();
                    j = xy.InfoNum("i_engageinfo", "P_ID", id);
                    if (j <= 0)
                    {
                        i = post.Delete(id);
                    }
                }
                if (ename.Equals("exhibition"))
                {
                    XYECOM.Business.ShowType showtype = new XYECOM.Business.ShowType(); ;
                    j = xy.InfoNum("XY_showinfo", "typeid", id);
                    if (j <= 0)
                    {
                        i = showtype.Delete(id);
                    }
                }
            }
            else
            {
                if (ename.Equals("offer") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("offer"))
                {
                    XYECOM.Business.ProductType pt = new XYECOM.Business.ProductType();
                    j = xy.InfoNum("i_supply", "PT_ID", id);
                    if (j <= 0)
                    {
                        i = pt.Delete(id);
                    }
                }
                if (ename.Equals("investment") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("investment"))
                {
                    XYECOM.Business.InviteBusinessType it = new XYECOM.Business.InviteBusinessType();
                    j = xy.InfoNum("i_invitebusinessmaninfo", "IT_ID", id);
                    if (j <= 0)
                    {
                        i = it.Delete(id);
                    }
                }
                if (ename.Equals("service") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("service"))
                {
                    XYECOM.Business.ServiceType st = new XYECOM.Business.ServiceType(); ;
                    j = xy.InfoNum("i_serviceinfo", "ST_ID", id);
                    if (j <= 0)
                    {
                        i = st.Delete(id);
                    }
                }
            }
        }
        if (j > 0)
        {
            backURL = "Typelist.aspx?ename=" + ename + "&del='1'&orderid=" + XYECOM.Core.XYRequest.GetQueryString("ParentID");
            Alert("�÷����º�����Ϣ��", backURL);
        }
        if (i > 0)
        {
            isfirstid = id;
            Response.Redirect("Typelist.aspx?ename=" + ename + "&del='1'&orderid=" + XYECOM.Core.XYRequest.GetQueryString("ParentID"));
        }
    }