Beispiel #1
0
 private void GetProductSubType()
 {
     XYECOM.Business.ProductType productTypeBLL = new ProductType();
     int parentId = XYECOM.Core.XYRequest.GetQueryInt("pid", 0);
     if (parentId < 0) parentId = 0;
     List<XYECOM.Model.ProductTypeInfo> infos = productTypeBLL.GetItems(parentId);
     StringBuilder data = new StringBuilder();
     foreach (XYECOM.Model.ProductTypeInfo info in infos)
     {
         data.Append("<Item><ID>");
         data.Append(info.PT_ID);
         data.Append("</ID><Name>");
         data.Append(info.PT_Name);
         data.Append("</Name>");
         data.Append("<ParentId>");
         data.Append(info.PT_ParentID);
         data.Append("</ParentId>");
         data.Append("<FullId>");
         data.Append(XYECOM.Core.Utils.RemoveComma((info.FullId + info.PT_ID).Replace(",0,", "")));
         data.Append("</FullId>");
         data.Append("<IsLeaf>");
         data.Append(info.IsLeaf);
         data.Append("</IsLeaf>");
         data.Append("</Item>");
     }
     ResponseXML(Result.Success, "", data.ToString());
 }
Beispiel #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"));
        }
    }
Beispiel #3
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;
            }
        }
Beispiel #4
0
    private void CreateProductTypeHTML(int PT_ID,string moduleName)
    {
        try
        {
            string str = "";
            string strlist = "";
            XYECOM.Business.ProductType pt = new XYECOM.Business.ProductType();
            XYECOM.Model.ProductTypeInfo et = new XYECOM.Model.ProductTypeInfo();
            if (PT_ID == 0)
            {
                str += "请选择供求类别";
                strlist += "<a href=\"#\" onclick=\"selecttypelist(0,this);\">请选择供求类别</a>";
            }
            else
            {
                et = pt.GetItem(PT_ID);

                str += et.PT_Name.ToString();
                strlist += "<a href=\"#\" onclick=\"selecttypelist(" + et.PT_ID.ToString() + ",this);\">" + et.PT_Name.ToString() + "</a>";
            }
            str += "$";
            DataTable dt = pt.GetDataTable(PT_ID, moduleName);
            DataTable dt1 = pt.GetDataTable(-1);
            if (dt.Rows.Count > 0)
            {
                strlist += " <ul class=\"subset\">";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    str += "    <a href=\"#\" title=\"点击选择此项\" onclick=\"selecttypeinfo(" + dt.Rows[i]["PT_ID"].ToString() + ",'" + dt.Rows[i]["PT_Name"].ToString() + "');\">" + dt.Rows[i]["PT_Name"].ToString() + "</a>";
                    strlist += "<li class=\"";
                    dt1.DefaultView.RowFilter = "PT_ParentID=" + dt.Rows[i]["PT_ID"].ToString();
                    DataView dv1 = dt1.DefaultView;
                    if (dv1.Count > 0)
                        strlist += "shrink\" ><a href=\"#\" onclick=\"selecttypelist(" + dt.Rows[i]["PT_ID"].ToString() + ",this);\">" + dt.Rows[i]["PT_Name"].ToString() + "</a></li>";
                    else
                        strlist += "sublast\" >" + dt.Rows[i]["PT_Name"].ToString() + "</li>";

                }
                strlist += "</ul>";

            }
            else
            {
                str += " ";
            }

            str += "$";

            str += strlist;
            Response.Write(str);
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.Replace("\n", ""));
        }
    }