Ejemplo n.º 1
0
    public void NewBind()
    {
        WebSite.BLL.Bll_BaseType BBaseType = new WebSite.BLL.Bll_BaseType();
        String    strWhere = String.Empty;
        DataTable dt       = new DataTable();

        strWhere = " State=1 AND ParentID =" + ParentId + " AND WebSiteID=" + PageCommon.LanguageID;
        List <WebSite.Model.Mod_BaseType> MBaseType = new List <WebSite.Model.Mod_BaseType>();

        dt        = BBaseType.GetList(strWhere + " ORDER BY OrderBy DESC,ID asc").Tables[0];
        stylehtml = dt.Rows.Count.ToString();
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            if (dt.Rows[i]["Link"].ToString() != "")
            {
                LeftHtml += GetHref(dt.Rows[i]["Link"].ToString(), dt.Rows[i]["Title"].ToString(), dt.Rows[i]["ID"].ToString());
            }
            else
            {
                switch (dt.Rows[i]["Model"].ToString())
                {
                case "DTSQ": LeftHtml += "<li " + GetClass(dt.Rows[i]["ID"].ToString()) + " hsm=\"fadel\"><a href=\"NewsList.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\"  " + GetClass(dt.Rows[i]["ID"].ToString()) + ">" + dt.Rows[i]["Title"].ToString() + "</a></li>";
                    break;

                case "CPXX": LeftHtml += "<li " + GetClass(dt.Rows[i]["ID"].ToString()) + " hsm=\"fadel\"><a href=\"ProductList.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\"  " + GetClass(dt.Rows[i]["ID"].ToString()) + ">" + dt.Rows[i]["Title"].ToString() + "</a></li>";
                    break;

                default: LeftHtml += "<li " + GetClass(dt.Rows[i]["ID"].ToString()) + " hsm=\"fadel\"><a href=\"about.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\" >" + dt.Rows[i]["Title"].ToString() + "</a></li>";
                    break;
                }
            }
        }
    }
Ejemplo n.º 2
0
    public void NewBind()
    {
        WebSite.BLL.Bll_BaseType BBaseType = new WebSite.BLL.Bll_BaseType();
        String    strWhere = String.Empty;
        DataTable dt       = new DataTable();

        //strWhere = " State=1 AND WebSiteID=10001 AND ParentID=0 and Model ='" + Model + "'";
        strWhere = " State=1 AND ParentID =" + ParentId;

        List <WebSite.Model.Mod_BaseType> MBaseType = new List <WebSite.Model.Mod_BaseType>();

        dt = BBaseType.GetList(0, strWhere, "OrderBy asc,id asc").Tables[0];
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            if (dt.Rows[i]["Link"].ToString() != "")
            {
                LeftHtml += GetHref(dt.Rows[i]["Link"].ToString(), dt.Rows[i]["Title"].ToString(), dt.Rows[i]["ID"].ToString());
            }
            else
            {
                switch (dt.Rows[i]["Model"].ToString())
                {
                case "News": LeftHtml += "<a href=\"News.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\" " + GetClass(dt.Rows[i]["ID"].ToString()) + ">" + dt.Rows[i]["Title"].ToString() + "</a>"; break;

                case "Product": LeftHtml += "<a href=\"ProductList.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\" " + GetClass(dt.Rows[i]["ID"].ToString()) + " >" + dt.Rows[i]["Title"].ToString() + "</a>"; break;

                default: LeftHtml += "<a href=\"about.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\" " + GetClass(dt.Rows[i]["ID"].ToString()) + ">" + dt.Rows[i]["Title"].ToString() + "</a>";

                    break;
                }
            }
        }
    }
Ejemplo n.º 3
0
    public string NewBind(string ParentId)
    {
        string LeftHtml = string.Empty;



        WebSite.BLL.Bll_BaseType BBaseType = new WebSite.BLL.Bll_BaseType();
        String    strWhere = String.Empty;
        DataTable dt       = new DataTable();

        strWhere = " ID!=10147 AND State=1 AND ParentID =" + ParentId + " AND WebSiteID=" + PageCommon.LanguageID;
        WebSite.Model.Mod_BaseType MBaseType = PageCommon.GetModelType(ParentId);
        if (MBaseType == null)
        {
            return("");
        }
        dt = BBaseType.GetList(strWhere + " order by OrderBy desc,ID asc ").Tables[0];

        LeftHtml = "<li><a href=\"" + MBaseType.Link + "\" " + GetClass(MBaseType.ID.ToString()) + ">" + MBaseType.Title + "</a>";



        if (dt.Rows.Count > 1)
        {
            LeftHtml += "<div class=\"sub-nav abs\">";


            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i]["Link"].ToString() != "")
                {
                    LeftHtml += "<a href=\"" + dt.Rows[i]["Link"].ToString() + "\"  class=\"db\">" + dt.Rows[i]["Title"].ToString() + "</a>";
                }
                else
                {
                    switch (dt.Rows[i]["Model"].ToString())
                    {
                    case "DTSQ": LeftHtml += "<a href=\"NewsList.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\" class=\"db\">" + dt.Rows[i]["Title"].ToString() + "</a>";

                        break;

                    case "CPXX": LeftHtml += "<a href=\"ProductList.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\" class=\"db\" >" + dt.Rows[i]["Title"].ToString() + "</a>";

                        break;

                    default: LeftHtml += "<a href=\"about.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\" class=\"db\" >" + dt.Rows[i]["Title"].ToString() + "</a>";

                        break;
                    }
                }
            }
            LeftHtml += "</div>";
        }
        LeftHtml += "</li>";
        return(LeftHtml);
    }
Ejemplo n.º 4
0
    public string NewBind(string ParentId)
    {
        string LeftHtml = string.Empty;

        WebSite.BLL.Bll_BaseType BBaseType = new WebSite.BLL.Bll_BaseType();
        String    strWhere = String.Empty;
        DataTable dt       = new DataTable();

        strWhere = " ID!=10147 AND  State=1 AND ParentID =" + ParentId + " AND WebSiteID=" + PageCommon.LanguageID;
        WebSite.Model.Mod_BaseType MBaseType = PageCommon.GetModelType(ParentId);
        if (MBaseType == null)
        {
            return("");
        }
        dt = BBaseType.GetList(strWhere + " order by OrderBy desc,ID asc ").Tables[0];



        LeftHtml = "<dl class=\"fl\"><dt><a href=\"" + MBaseType.Link + "\">" + MBaseType.Title + "</a></dt>";
        if (dt.Rows.Count > 1)
        {
            LeftHtml += "<div class=\"gdlt\">";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i]["Link"].ToString() != "")
                {
                    LeftHtml += "<dd><a href=\"" + dt.Rows[i]["Link"].ToString() + "\">" + dt.Rows[i]["Title"].ToString() + "</a></dt>";
                }
                else
                {
                    switch (dt.Rows[i]["Model"].ToString())
                    {
                    case "CPHZZ": LeftHtml += "<dd><a href=\"ProductList.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\" >" + dt.Rows[i]["Title"].ToString() + "</a></dt>";
                        break;

                    case "XTHJJFA": LeftHtml += "<dd><a href=\"Solution.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\" >" + dt.Rows[i]["Title"].ToString() + "</a></dt>";
                        break;

                    case "KJDZ": LeftHtml += "<dd><a href=\"Custom.aspx#" + dt.Rows[i]["ID"].ToString() + "\" >" + dt.Rows[i]["Title"].ToString() + "</a></dt>";
                        break;

                    default: LeftHtml += "<dd><a href=\"about.aspx?TypeId=" + dt.Rows[i]["ID"].ToString() + "\" >" + dt.Rows[i]["Title"].ToString() + "</a></dt>";
                        break;
                    }
                }
            }
        }
        LeftHtml += "</dl>";
        return(LeftHtml);
    }
Ejemplo n.º 5
0
    public String GetTypePath()
    {
        String strHref = String.Empty;

        string[] arrIDPath = ObjIDPath.ToString().Split(',');
        WebSite.BLL.Bll_BaseType   GetInfo   = new WebSite.BLL.Bll_BaseType();
        WebSite.Model.Mod_BaseType ModelInfo = new WebSite.Model.Mod_BaseType();
        for (int i = 0; i < arrIDPath.Length; i++)
        {
            ModelInfo = PageCommon.GetModelType(Convert.ToInt32(arrIDPath[i]));
            string strLink = string.Empty;


            //if (ModelInfo.Link!= "")
            //{
            //    strLink = ModelInfo.Link;
            //}
            //else
            //{
            //    switch (ModelInfo.Model)
            //    {
            //        case "ZL": strLink = "ExhibitionList.aspx?TypeId=" + ModelInfo.ID;
            //            break;
            //        case "BNTB": strLink = "AnniversaryList.aspx?TypeId=" + ModelInfo.ID;
            //            break;
            //        case "YJ":
            //        case "HD": strLink = "News.aspx?TypeId=" + ModelInfo.ID;
            //            break;
            //        case "DC": strLink = "collection.aspx?TypeId=" + ModelInfo.ID;
            //            break;
            //        default: strLink = "about.aspx?TypeId=" + ModelInfo.ID;
            //            break;
            //    }
            //}



            if ((i + 1) == arrIDPath.Length)
            {
                LeftHtml += " > " + ModelInfo.Title + " ";
            }
            else
            {
                LeftHtml += " > " + ModelInfo.Title + " ";
            }
        }

        return(strHref);
    }
Ejemplo n.º 6
0
    public static int GetParentId(int TypeId)
    {
        string strPath = string.Empty;

        WebSite.BLL.Bll_BaseType   GetInfo     = new WebSite.BLL.Bll_BaseType();
        WebSite.Model.Mod_BaseType modBaseType = PageCommon.GetModelType(TypeId);

        if (modBaseType == null)
        {
            return(0);
        }
        string ObjIDPath = modBaseType.IDPath;

        string[] arrIDPath = ObjIDPath.ToString().Split(',');

        return(StringHelper.StrToInt(arrIDPath[0], 0));
    }
Ejemplo n.º 7
0
    private void DdlstTypeNameBind()
    {
        WebSite.BLL.Bll_BaseType BBaseType = new WebSite.BLL.Bll_BaseType();

        string strWhere = " WebSiteID=" + AdminManage.WebSiteID + " ";

        ddlstTypeName.Items.Clear();
        ListItem li = new ListItem("一级栏目", "0");

        ddlstTypeName.Items.Add(li);

        DataSet ds = BBaseType.GetList(strWhere);

        if (ds != null && ds.Tables.Count > 0)
        {
            DataTable dt = ds.Tables[0];
            GetTree(ddlstTypeName, dt, 0, 0);
        }
    }
Ejemplo n.º 8
0
    public static string GetTypePath(int TypeId)
    {
        string strPath = string.Empty;

        WebSite.BLL.Bll_BaseType   GetInfo     = new WebSite.BLL.Bll_BaseType();
        WebSite.Model.Mod_BaseType modBaseType = PageCommon.GetModelType(TypeId);


        if (modBaseType == null)
        {
            return("<span>></span><p>Product</p>");
        }
        string ObjIDPath = modBaseType.IDPath;

        string[] arrIDPath = ObjIDPath.ToString().Split(',');

        WebSite.Model.Mod_BaseType ModelInfo = new WebSite.Model.Mod_BaseType();
        for (int i = 0; i < arrIDPath.Length; i++)
        {
            ModelInfo = PageCommon.GetModelType(arrIDPath[i]);
            string strLink = string.Empty;
            if ((i + 1) == arrIDPath.Length)
            {
                strPath += " <span>></span><p>" + ModelInfo.Title + "</p>";
            }
            else
            {
                if (i == 0)
                {
                    strPath += " <span>></span><p ><a href=\"/ProductIndex.aspx?TypeId=" + ModelInfo.ID + "\" style=\"color:#000\">" + ModelInfo.Title + "</a></p>";
                }
                else
                {
                    strPath += " <span>></span><p ><a href=\"/ProductList.aspx?TypeId=" + ModelInfo.ID + "\" style=\"color:#000\">" + ModelInfo.Title + "</a></p>";
                }
            }
        }
        return(strPath);
    }
Ejemplo n.º 9
0
    /// <summary>
    /// 获取分类信息
    /// </summary>
    /// <param name="TypeId"></param>
    /// <returns></returns>
    public static WebSite.Model.Mod_BaseType GetModelType(object TypeId)
    {
        WebSite.BLL.Bll_BaseType bll_BaseType = new WebSite.BLL.Bll_BaseType();

        return(bll_BaseType.GetModel(string.Format(" ID ={0} AND WebSiteID={1}", TypeId, PageCommon.LanguageID)));
    }
Ejemplo n.º 10
0
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        if (txtTitle.Text.Trim() == "")
        {
            MessageBox.Show(this, "请填写完整信息再提交保存");
            return;
        }
        Mod_AdminMenu dto         = new Mod_AdminMenu();
        string        ParentIDStr = string.Empty;
        string        IDPathStr   = string.Empty;
        string        strtype     = string.Empty;

        if (id != 0)
        {
            dto         = BAdmin_Menu.GetModel(id);
            strtype     = dto.TypeName;
            ParentIDStr = dto.ParentID.ToString();
            IDPathStr   = dto.IDPath;
        }
        dto.Title    = txtTitle.Text.Trim();
        dto.ParentID = int.Parse(ddlMenu.SelectedValue);
        dto.State    = int.Parse(rblState.SelectedValue);
        dto.IsCopy   = int.Parse(rblIsCopy.SelectedValue);

        dto.Url       = txtUrl.Text.Trim();
        dto.OrderBy   = int.Parse(txtOrderBy.Text.Trim());
        dto.WebSiteID = int.Parse(ddlWebSite.SelectedValue);

        dto.FunctionModel = FunctionModel.Text;
        dto.TypeName      = ddlstTypeName.SelectedValue;
        dto.WebSiteManage = ddlWebSiteManage.SelectedValue;
        dto.Attributes    = GetChecked(this.cblShow, ",");

        string parameter = string.Empty;

        for (int i = 0; i < cblShow.Items.Count; i++)
        {
            if (cblShow.Items[i].Selected)
            {
                parameter += "&" + cblShow.Items[i].Value + "=1";
            }
        }

        if (id != 0)
        {
            string strHref = string.Empty;
            switch (ddlWebSiteManage.SelectedValue)
            {
            case "Type":     //分类管理
                strHref = "Column/BaseType/List.aspx?Model={0}&IsAdd=1" + parameter;
                dto.Url = string.Format(strHref, FunctionModel.Text);
                break;

            case "About":    //单篇文章
                if (strtype != dto.TypeName)
                {
                    strHref = "Column/About/Edit.aspx?ID={1}" + parameter;
                    WebSite.BLL.Bll_BaseType      BBaseType    = new WebSite.BLL.Bll_BaseType();
                    WebSite.BLL.Bll_Information   BInformation = new WebSite.BLL.Bll_Information();
                    WebSite.Model.Mod_Information MInformation = new WebSite.Model.Mod_Information();
                    WebSite.Model.Mod_BaseType    MBaseType    = new WebSite.Model.Mod_BaseType();

                    MBaseType = BBaseType.GetModel(string.Format("ID={0} AND WebSiteID={1}", this.ddlstTypeName.SelectedValue, AdminManage.WebSiteID));

                    MInformation.Title     = MBaseType.Title;
                    MInformation.TypeID    = int.Parse(ddlstTypeName.SelectedItem.Value);
                    MInformation.State     = 1;
                    MInformation.Content1  = MBaseType.Title;
                    MInformation.Model     = MBaseType.Model.ToString();
                    MInformation.WebSiteID = AdminManage.WebSiteID;
                    MInformation.AddDate   = DateTime.Now;
                    int flag = BInformation.Add(MInformation);
                    MInformation.ID = flag;
                    BInformation.Update(MInformation);
                    dto.Url = string.Format(strHref, MInformation.Model, flag);
                }
                else
                {
                    dto.Url = dto.Url.Split('&')[0] + parameter;
                }
                break;

            case "News":    //文字新闻
                strHref = "Column/Information/List.aspx?Model={0}&managetype={1}" + parameter;
                dto.Url = string.Format(strHref, FunctionModel.Text, ddlstTypeName.SelectedValue);
                break;

            case "Link":     //友情链接
                strHref = "Column/Link/List.aspx?Model={0}" + parameter;
                dto.Url = string.Format(strHref, FunctionModel.Text);
                break;
            }
            BAdmin_Menu.Update(dto, true);
        }
        else
        {
            string strHref = string.Empty;
            switch (ddlWebSiteManage.SelectedValue)
            {
            case "Type":     //分类管理
                strHref = "Column/BaseType/List.aspx?Model={0}&IsAdd=1" + parameter;
                dto.Url = string.Format(strHref, FunctionModel.Text);
                break;

            case "About":    //单篇文章
                strHref = "Column/About/Edit.aspx?ID={1}" + parameter;
                WebSite.BLL.Bll_BaseType      BBaseType    = new WebSite.BLL.Bll_BaseType();
                WebSite.BLL.Bll_Information   BInformation = new WebSite.BLL.Bll_Information();
                WebSite.Model.Mod_Information MInformation = new WebSite.Model.Mod_Information();
                WebSite.Model.Mod_BaseType    MBaseType    = new WebSite.Model.Mod_BaseType();

                MBaseType              = BBaseType.GetModel(string.Format("ID={0} AND WebSiteID={1}", this.ddlstTypeName.SelectedValue, AdminManage.WebSiteID));
                MInformation.Title     = MBaseType.Title;
                MInformation.TypeID    = int.Parse(ddlstTypeName.SelectedItem.Value);
                MInformation.State     = 1;
                MInformation.Content1  = MBaseType.Title;
                MInformation.Model     = MBaseType.Model.ToString();
                MInformation.WebSiteID = AdminManage.WebSiteID;
                MInformation.AddDate   = DateTime.Now;
                int flag = BInformation.Add(MInformation);
                MInformation.ID = flag;
                BInformation.Update(MInformation);
                dto.Url = string.Format(strHref, MInformation.Model, flag);
                break;

            case "News":    //文字新闻
                strHref = "Column/Information/List.aspx?Model={0}&managetype={1}" + parameter;
                dto.Url = string.Format(strHref, FunctionModel.Text, ddlstTypeName.SelectedValue);
                break;

            case "Link":     //友情链接
                strHref = "Column/Link/List.aspx?Model={0}" + parameter;
                dto.Url = string.Format(strHref, FunctionModel.Text);
                break;
            }

            BAdmin_Menu.Add(dto, true);
        }

        MessageBox.ShowRedirect(this, "信息(" + txtTitle.Text.Trim() + ")保存成功!", "Column/Admin_Menu/List.aspx?" + StringHelper.DelUrlParameter("ID"));
    }