示例#1
0
    public void DataBind()
    {
        WebSite.BLL.Bll_Information BInformation = new WebSite.BLL.Bll_Information();
        if (Request.QueryString["current"] != null)
        {
            pageIndex = WebSite.Common.DNTRequest.GetQueryInt("current");
        }
        String PageWhere = WebSite.Common.DNTRequest.GetParameter();

        String strWhere = "WebSiteID=" + PageCommon.LanguageID + " and State='1'";

        if (TypeId != 0)
        {
            strWhere += " and TypeId=" + TypeId;
        }

        int TotleNum = 0;

        ModelList = new WebSite.BLL.Bll_Information().GetModelListByPage(strWhere, Order, pageIndex, PageSize, out TotleNum);


        if (id != 0)
        {
            ModelInfo = PageCommon.GetModelInformation(id);
        }
        else if (ModelList.Count > 0)
        {
            ModelInfo = ModelList[0];
        }
    }
示例#2
0
    public void DataBind()
    {
        WebSite.BLL.Bll_Information BInformation = new WebSite.BLL.Bll_Information();
        if (Request.QueryString["current"] != null)
        {
            pageIndex = WebSite.Common.DNTRequest.GetQueryInt("current");
        }
        String PageWhere = WebSite.Common.DNTRequest.GetParameter();

        strWhere += " and WebSiteID=" + PageCommon.LanguageID + " and State='1'";
        if (Model != "")
        {
            strWhere += " and model='" + Model + "'";
        }

        if (TypeId != "")
        {
            strWhere += " and IDPath like '%" + TypeId + "%' ";
        }
        if (WebSite.Common.DNTRequest.GetQueryStringStringDecode("keys").Trim() != "")
        {
            string Titel = WebSite.Common.DNTRequest.GetQueryStringStringDecode("keys").Trim();
            strWhere += " and title like '%" + WebSite.Common.StringHelper.CleanDangerSQL(Titel) + "%' ";
        }

        string Tags = WebSite.Common.DNTRequest.GetQueryStringStringDecode("Tags").Trim();

        if (Tags != "")
        {
            foreach (var item in Tags.Split(','))
            {
                strWhere += " and title like '%" + item + "%' ";
            }
        }

        int TotleNum = 0;

        ModelInfo = new WebSite.BLL.Bll_VW_Information().GetModelListByPage(strWhere, Order, pageIndex, PageSize, out TotleNum);


        PageHtml    = PageHelper.NewPageHtml(TotleNum, pageIndex, PageSize, PageWhere);
        TopPageHtml = PageHelper.TopPageHtml(TotleNum, pageIndex, PageSize, PageWhere);
    }
示例#3
0
    public void DataBind()
    {
        WebSite.BLL.Bll_Information BInformation = new WebSite.BLL.Bll_Information();
        if (Request.QueryString["current"] != null)
        {
            pageIndex = WebSite.Common.DNTRequest.GetQueryInt("current");
        }
        String PageWhere = WebSite.Common.DNTRequest.GetParameter();

        String strWhere = "WebSiteID=" + PageCommon.LanguageID + " and State='1'";

        if (TypeId != 0)
        {
            strWhere += " and IDPath like '%" + TypeId + "%' ";
        }

        int TotleNum = 0;

        ModelList = new WebSite.BLL.Bll_VW_Information().GetModelListByPage(strWhere, Order, pageIndex, PageSize, out TotleNum);


        PageHtml = PageHelper.NewPageHtml(TotleNum, pageIndex, PageSize, PageWhere);
    }
示例#4
0
文件: Edit.aspx.cs 项目: hongsms/test
    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"));
    }