Exemplo n.º 1
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        protected string GetList()
        {
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            ShowShop.BLL.SystemInfo.Navigation data = new ShowShop.BLL.SystemInfo.Navigation();
            ChangeHope.DataBase.DataByPage dataPage = data.GetList();
            //第一步先添加表头
            table.AddHeadCol("5%", "序号");
            table.AddHeadCol("12%", "系统内容");
            table.AddHeadCol("16%", "导航名称");
            table.AddHeadCol("18%", "链接");
            table.AddHeadCol("8%", "导航类型");
            table.AddHeadCol("4%", "排序");
            table.AddHeadCol("8%", "是否显示");
            table.AddHeadCol("10%", "是否新窗口");
            table.AddHeadCol("6%", "位置");
            table.AddHeadCol("15%", "操作");
            table.AddRow();
            //添加表的内容
            if (dataPage.DataReader != null)
            {
                int curpage = ChangeHope.WebPage.PageRequest.GetInt("pageindex");
                if (curpage < 0)
                {
                    curpage = 1;
                }
                int count = 0;
                ShowShop.BLL.SystemInfo.ArticleChannel bllarticle = new ShowShop.BLL.SystemInfo.ArticleChannel();
                while (dataPage.DataReader.Read())
                {
                    count++;
                    string No = (15 * (curpage - 1) + count).ToString();
                    table.AddCol(No);
                    //table.AddCol(bllarticle.GetArticleName(dataPage.DataReader["contentregion"].ToString()));
                    table.AddCol(dataPage.DataReader["contentregion"].ToString());
                    table.AddCol(dataPage.DataReader["filed"].ToString());
                    table.AddCol(dataPage.DataReader["link"].ToString());
                    table.AddCol(Type(dataPage.DataReader["type"].ToString()));
                    table.AddCol(string.Format("<input id='sort{0}' value='{1}' size='3' width='40px' onblur='Sort({0},{1})'/>", dataPage.DataReader["id"].ToString(), dataPage.DataReader["sort"].ToString()));
                    table.AddCol(string.Format("<img src='../images/{0}.gif'/>", dataPage.DataReader["isshow"].ToString()));
                    table.AddCol(string.Format("<img src='../images/{0}.gif'/>", dataPage.DataReader["isnewwindow"].ToString()));
                    table.AddCol(Part(dataPage.DataReader["part"].ToString()));
                    table.AddCol(string.Format("<a href=navigation_customize.aspx?id={0}>编辑</a> <a href='#' onclick='Del({0})'>删除</a>", dataPage.DataReader["id"].ToString()));

                    table.AddRow();
                }
            }
            string view = table.GetTable() + dataPage.PageToolBar;
            dataPage.Dispose();
            dataPage = null;
            return view;
        }
 public void GetParentChannel(string channelid)
 {
     ShowShop.BLL.SystemInfo.ArticleChannel bll = new ShowShop.BLL.SystemInfo.ArticleChannel();
     StringBuilder text = new StringBuilder();
     SortedList hashtable = bll.GetChannel(channelid);
     foreach (DictionaryEntry de in hashtable)
     {
         text.Append(" → <a href='?q_chanelid="+de.Key.ToString()+"'>" + de.Value.ToString()+"</a>");
     }
     hashtable.Clear();
     hashtable = null;
     this.link.Text = text.ToString().Substring(2);
     bll = null;
 }
Exemplo n.º 3
0
        public void GetParentChannel(string channelid)
        {
            ShowShop.BLL.SystemInfo.ArticleChannel bll = new ShowShop.BLL.SystemInfo.ArticleChannel();
            StringBuilder text = new StringBuilder();
            SortedList hashtable = bll.GetChannel(channelid);
            text.AppendLine("<a href='article_edit.aspx?channelid=" + channelid + "'><font color='Blue'>添加资讯</font></a>");
            int index = 0;
            //获取父路径
            foreach (DictionaryEntry de in hashtable)
            {
                if (index == 0)
                {
                    text.AppendLine(" ◎ ");
                }
                else
                {
                    text.AppendLine(" → ");
                }
                text.AppendLine("<a href='?w_z_channel=" + de.Key.ToString() + "'>" + de.Value.ToString() + "</a>");
                index++;
            }
            hashtable.Clear();
            hashtable = null;

            //获取子路径
            hashtable = bll.GetChildChannel(channelid);

            index = 0;
            foreach (DictionaryEntry de in hashtable)
            {
                if (index == 0)
                {
                    text.AppendLine(" ◎ ");
                }
                else
                {
                    text.AppendLine(" ");
                }
                text.Append("<a href='?w_z_channel=" + de.Key.ToString() + "'><font color='#FF9900'>" + de.Value.ToString() + "</font></a>");
                index++;
            }
            hashtable.Clear();
            hashtable = null;
            this.ltlLink.Text += text.ToString();
            bll = null;
        }
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="id"></param>
 private void Del(string id)
 {
     ShowShop.BLL.SystemInfo.ArticleChannel bll = new ShowShop.BLL.SystemInfo.ArticleChannel();
     if (bll.HasChild(Convert.ToInt32(id))) //判断旗下是否有子频道
     {
         Response.Write("haschild");
         return;
     }
     ShowShop.BLL.SystemInfo.Article abll = new ShowShop.BLL.SystemInfo.Article();
     if (abll.ExistByCid(Convert.ToInt32(id))) //判断该频道下是否有文章
     {
         Response.Write("hasarticel");
         return;
     }
     bll.Delete(id);
     Response.Write("ok");
 }
 private void InitWebControls()
 {
     ShowShop.BLL.SystemInfo.ArticleChannel bll = new ShowShop.BLL.SystemInfo.ArticleChannel();
     string channelid = ChangeHope.WebPage.PageRequest.GetQueryString("channelid");
     bll.GetDropList(this.ddlChannel, channelid);
     bll = null;
     ChangeHope.WebPage.WebControl.Validate(this.txtName, "频道名称,频道下面可以设置子频道,频道名称设置为4~10个字符", "isnull_4_10", "必填", "该项为必填项");
     ChangeHope.WebPage.WebControl.Validate(this.txtProjectName, "比如是文章的话,项目就是文章或者新闻或者通讯等", "isnull", "必填", "该项为必填项");
     ChangeHope.WebPage.WebControl.Validate(this.txtProjectUtil, "该频道的文章的单位,比如是文章的话就是X篇,通讯的话就是X条等", "isnull", "必填", "该项为必填项");
     ChangeHope.WebPage.WebControl.Validate(this.txtTemplate, "该频道的网页模板,按照要求制定,选择文件夹", "isnull", "必填", "该项为必填项");
     ChangeHope.WebPage.WebControl.Validate(this.txtMeteKey, "该频道的文章的单位,比如是文章的话就是X篇,通讯的话就是X条等", "isnull", "必填", "该项为必填项");
     ChangeHope.WebPage.WebControl.Validate(this.txtMeteDescription, "该频道的文章的单位,比如是文章的话就是X篇,通讯的话就是X条等", "isnull", "必填", "该项为必填项");
     this.ckbType.Items[0].Attributes.Add("onclick", "changetype(this.value)");
     this.ckbType.Items[1].Attributes.Add("onclick","changetype(this.value)");
     this.ckbType.Items[2].Attributes.Add("onclick","changetype(this.value)");
     this.Form.Attributes.Add("onsubmit", "return CheckForm();");
     GetMemberRank();
 }
        private void GetModel()
        {
            string id = ChangeHope.WebPage.PageRequest.GetQueryString("id");
            ShowShop.BLL.SystemInfo.ArticleChannel bll = new ShowShop.BLL.SystemInfo.ArticleChannel();
            Model.SystemInfo.ArticleChannel model = bll.GetModel(id);
            if(model!=null)
            {
                this.txtDescription.Text = model.Description;
                this.txtId.Value = model.Id;
                this.txtName.Text = model.Name;
                this.txtShop.SelectedValue = model.Shop;
                this.ckbType.SelectedValue = model.Type;
                if (model.Type == "2")
                {
                    Page.RegisterStartupScript("ggg", "<script>changetype(2);</script>");
                }
                this.txtProjectName.Text = model.ProjectName;
                this.txtProjectUtil.Text = model.ProjectUtil;
                this.ckbTarget.SelectedValue = model.Target;
                this.txtAddress.Text = model.ExternalLink;
                this.txtWebPagePath.Text = model.DefaultTemplate;
                this.txtListPageTemplate.Text = model.ListTemplate;
                this.txtContentPageTemplate.Text = model.ContentTemplate;
                //this.txtTemplate.Text = model.Template;
                this.txtMeteKey.Text = model.MeteKey;
                this.txtMeteDescription.Text = model.MeteDescription;
                this.txtWebPagePath.Text = model.DefaultTemplate;
                this.txtListPageTemplate.Text = model.ListTemplate;
                this.txtContentPageTemplate.Text = model.ContentTemplate;

                foreach (ListItem item in this.ckbPower.Items)
                {
                    if (model.Power.IndexOf(item.Value+",") >= 0)
                    {
                        item.Selected = true;
                    }
                }
            }
            model = null;
            bll = null;
        }
        private void Save()
        {
            ShowShop.BLL.SystemInfo.ArticleChannel bll = new ShowShop.BLL.SystemInfo.ArticleChannel();
            Model.SystemInfo.ArticleChannel model = new ShowShop.Model.SystemInfo.ArticleChannel();
            model.Description = this.txtDescription.Text;
            model.Name = this.txtName.Text;
            model.Shop = this.txtShop.SelectedValue;
                  model.Type = this.ckbType.SelectedValue;
            model.ProjectName = this.txtProjectName.Text;
            model.ProjectUtil = this.txtProjectUtil.Text;
            model.Target = this.ckbTarget.SelectedValue;
            model.ExternalLink = this.txtAddress.Text.Trim().ToString();
            model.MeteKey = this.txtMeteKey.Text;
            model.MeteDescription = this.txtMeteDescription.Text;
            model.DefaultTemplate = this.txtWebPagePath.Text;
            model.ListTemplate = this.txtListPageTemplate.Text;
            model.ContentTemplate = this.txtContentPageTemplate.Text;
            model.Power = "";
            foreach (ListItem item in this.ckbPower.Items)
            {
                if (item.Selected)
                {
                    model.Power = model.Power  + item.Value+ ",";
                }
            }

            if(this.txtId.Value.Equals(""))
            {
                this.txtId.Value = bll.GetMaxId(this.txtParentId.Value);
            }
            model.Id = txtId.Value;
            ShowShop.Model.Admin.AdminInfo adminInfo = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get();
            if (adminInfo != null)
            {
                model.Users = adminInfo.AdminName;
            }
            if (bll.Exists(model.Id))
            {
                bll.Update(model);
            }
            else
            {
                bll.Add(model);
            }

            model = null;
            bll = null;
        }
 //private void GetFileList()
 //{
 //    ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
 //    ChangeHope.Common.FileHelper file = new ChangeHope.Common.FileHelper();
 //    StringBuilder filelist = new StringBuilder();
 //    file.rootUrl = Server.MapPath("~/" + sp.DummyPaht + sp.WebSiteTemplatePath + "/banner");
 //    file.listFileName(file.rootUrl, 0);
 //    filelist.AppendLine("<script type=\"text/javascript\">");
 //    filelist.AppendLine("d = new dTree('d');");
 //    filelist.AppendLine("d.add(0,-1,'请选择栏目模版文件夹');");
 //    filelist.AppendLine(file.fileTree.ToString());
 //    filelist.AppendLine("document.write(d);");
 //    filelist.AppendLine("$(\"fileLists\").style.visibility=\"hidden\";");
 //    filelist.AppendLine("</script>");
 //    this.ltlFileList.Text = filelist.ToString();
 //    file = null;
 //}
 private void GetParentChannel(string channelid)
 {
     ShowShop.BLL.SystemInfo.ArticleChannel bll = new ShowShop.BLL.SystemInfo.ArticleChannel();
     StringBuilder text = new StringBuilder();
     SortedList hashtable = bll.GetChannel(channelid);
     foreach (DictionaryEntry de in hashtable)
     {
         text.Append("→"+de.Value.ToString());
     }
     hashtable.Clear();
     hashtable = null;
     this.Label1.Text = text.ToString().Substring(1);
     bll = null;
 }
Exemplo n.º 9
0
 protected void BindChannel()
 {
     ShowShop.BLL.SystemInfo.ArticleChannel bll = new ShowShop.BLL.SystemInfo.ArticleChannel();
     string channelid = string.Empty;
     bll.GetDropList(this.w_d_Channel, channelid);
 }
        protected void BandInfo(int id)
        {
            ShowShop.BLL.SystemInfo.Navigation bll = new ShowShop.BLL.SystemInfo.Navigation();
            ShowShop.Model.SystemInfo.Navigation model = bll.GetModelID(id);
            bllarticle = new ShowShop.BLL.SystemInfo.ArticleChannel();
            if (model.Type == 1)
            {
                this.rdtype1.Checked = true;
                this.txtContentRegion1.Text = model.Contentregion;
                this.txtContentRegion2.Text = model.Contentregion;
                this.ddlContentRegion3.SelectedValue = bllarticle.GetArticleName(model.Contentregion);

            }
            else if (model.Type == 2)
            {
                this.rdtype2.Checked = true;
                this.txtContentRegion1.Text = model.Contentregion;
                this.txtContentRegion2.Text = model.Contentregion;
                this.ddlContentRegion3.SelectedValue = bllarticle.GetArticleName(model.Contentregion);

            }
            else if (model.Type == 3)
            {
                this.rdtype3.Checked = true;
                this.txtContentRegion1.Text = model.Contentregion;
                this.txtContentRegion2.Text = model.Contentregion;
                this.ddlContentRegion3.SelectedValue = bllarticle.GetArticleName(model.Contentregion);
            }
            this.txtField.Text = model.Filed;
            this.txtLink.Text = model.Link;
            this.txtSort.Text = model.Sort.ToString();
            if (model.Isshow == 1)
            {
                this.ddlIsShow.SelectedIndex = 0;
            }
            else
            {
                this.ddlIsShow.SelectedIndex = 1;
            }
            if (model.Isnewwindow == 1)
            {
                this.ddlIsNewWindow.SelectedIndex = 0;
            }
            else
            {
                this.ddlIsNewWindow.SelectedIndex = 1;
            }
            if (model.Part == 1)
            {
                this.ddlPart.SelectedIndex = 0;
            }
            else if (model.Part == 2)
            {
                this.ddlPart.SelectedIndex = 1;
            }
            else
            {
                this.ddlPart.SelectedIndex = 2;
            }
                ViewState["ID"] = model.Id;
        }
        /// <summary>
        /// 验证
        /// </summary>
        private void InitWebControl()
        {
            ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
            this.txtContentRegion1.Attributes.Add("readonly", "readonly");
            this.txtContentRegion1.Attributes.Add("onclick", "selectFile('Productclass',new Array(" + this.hfcConentRegion1.ClientID + "," + this.txtContentRegion1.ClientID + "),310,450,'" + sp.DummyPaht + "');");
            ChangeHope.WebPage.WebControl.Validate(this.txtField, "输入导航的名称", "isnull", "必填", "该项为必填项");
            ChangeHope.WebPage.WebControl.Validate(this.txtSort, "输入数字将作为显示的排列顺序", "isint", "必填", "该项为必填项");
            this.Form.Attributes.Add("onsubmit", "return CheckForm()");
            this.txtContentRegion1.Attributes.Add("readonly", "readonly");

            ShowShop.Common.SysParameter sp2 = new ShowShop.Common.SysParameter();
            this.txtContentRegion2.Attributes.Add("readonly", "readonly");
            this.txtContentRegion2.Attributes.Add("onclick", "selectFile('Productclass',new Array(" + this.hfcContentRegion2.ClientID + "," + this.txtContentRegion2.ClientID + "),310,450,'" + sp2.DummyPaht + "');");
            this.Form.Attributes.Add("onsubmit", "return CheckForm()");
            this.txtContentRegion2.Attributes.Add("readonly", "readonly");

            bllarticle= new ShowShop.BLL.SystemInfo.ArticleChannel();
            string channelid = ChangeHope.WebPage.PageRequest.GetQueryString("channelid");
            bllarticle.GetDropList(this.ddlContentRegion3, channelid);

            //ShowShop.Common.SysParameter sp3 = new ShowShop.Common.SysParameter();
            //this.ddlContentRegion3.Attributes.Add("readonly", "readonly");
            //this.ddlContentRegion3.Attributes.Add("onclick", "selectFile('Productclass',new Array(" + this.hfcContentRegion3.ClientID + "," + this.ddlContentRegion3.ClientID + "),310,450,'" + sp3.DummyPaht + "');");

            this.Form.Attributes.Add("onsubmit", "return CheckForm()");
            this.ddlContentRegion3.Attributes.Add("readonly", "readonly");
        }
        /// <summary>
        /// 保存信息
        /// </summary>
        protected void Save()
        {
            ShowShop.BLL.SystemInfo.Navigation bll = new ShowShop.BLL.SystemInfo.Navigation();
            ShowShop.Model.SystemInfo.Navigation model = new ShowShop.Model.SystemInfo.Navigation();
            bllarticle = new ShowShop.BLL.SystemInfo.ArticleChannel();
            //model.Id = !string.IsNullOrEmpty(hfcid.Value.Trim()) ? hfcid.Value.Trim() : "0";
            model.Filed = this.txtField.Text.Trim();
            if (this.rdtype1.Checked && !string.IsNullOrEmpty(txtContentRegion1.Text))
            {
                model.Type = 1;
                model.Contentregion = txtContentRegion1.Text;
            }
            else if (this.rdtype2.Checked && !string.IsNullOrEmpty(txtContentRegion2.Text))
            {
                model.Type = 2;
                model.Contentregion = txtContentRegion2.Text;
            }
            else if (this.rdtype3.Checked && !string.IsNullOrEmpty(ddlContentRegion3.SelectedValue))
            {
                model.Type = 3;
                model.Contentregion = bllarticle.GetArticleName(ddlContentRegion3.SelectedValue);//把id转换成导航类型
            }

            model.Isshow = ChangeHope.Common.StringHelper.StringToInt(this.ddlIsShow.SelectedValue);
            model.Isnewwindow = ChangeHope.Common.StringHelper.StringToInt(this.ddlIsNewWindow.SelectedValue);
            model.Sort = ChangeHope.Common.StringHelper.StringToInt(txtSort.Text.Trim());
            model.Part = ChangeHope.Common.StringHelper.StringToInt(ddlPart.SelectedValue);
            model.Link = this.txtLink.Text;

            if (ViewState["ID"] != null)
            {
                model.Id = int.Parse(ViewState["ID"].ToString());
                bll.Update(model);
                //BandInfo(int.Parse(ViewState["ID"].ToString()));
                this.ltlMsg.Text = "操作成功,已保存该信息";
                this.pnlMsg.Visible = true;
                this.pnlMsg.CssClass = "actionOk";
            }
            else
            {
                bll.Add(model);
                this.ltlMsg.Text = "操作成功,已保存该信息";
                this.pnlMsg.Visible = true;
                this.pnlMsg.CssClass = "actionOk";
            }
        }
 private void GetList()
 {
     ShowShop.BLL.SystemInfo.ArticleChannel bll = new ShowShop.BLL.SystemInfo.ArticleChannel();
     this.lblView.Text = bll.GetList();
     bll = null;
 }