private void RptBind()
 {
     BLL.channel_site bll = new BLL.channel_site();
     DataSet ds = bll.GetList(0, "is_mobile=0", "sort_id asc,id desc");
     this.rptList.DataSource = ds;
     this.rptList.DataBind();
 }
Example #2
0
 private void RptBind()
 {
     BLL.channel_site bll = new BLL.channel_site();
     DataSet ds = bll.GetList(0, string.Empty, "sort_id asc,id desc");
     this.rptList.DataSource = ds;
     this.rptList.DataBind();
 }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("sys_builder_html", DTEnums.ActionEnum.View.ToString()); //检查权限
                //绑定网点
                BLL.channel_site bll = new BLL.channel_site();
                DataTable        dt  = bll.GetList(0, "is_mobile=0", "is_default desc,sort_id asc,id desc").Tables[0];
                this.rblSiteId.Items.Clear();
                foreach (DataRow dr in dt.Rows)
                {
                    this.rblSiteId.Items.Add(new ListItem(dr["title"].ToString(), dr["id"].ToString()));
                }

                if (dt.Rows.Count == 1)
                {
                    this.site_id = Utils.StrToInt(dt.Rows[0]["id"].ToString(), 0);
                }

                if (this.site_id > 0)
                {
                    tabContent.Visible      = true;
                    rblSiteId.SelectedValue = this.site_id.ToString();

                    Model.channel_site model = new BLL.channel_site().GetModel(this.site_id);
                    this.build_path = model.build_path;
                    //是否继承
                    if (model.inherit_id > 0)
                    {
                        this.site_id = model.inherit_id;
                    }
                    RptBind(this.site_id);
                }
            }
        }
Example #4
0
        private void ShowInfo(int _id)
        {
            BLL.channel_site   bll   = new BLL.channel_site();
            Model.channel_site model = bll.GetModel(_id);

            txtTitle.Text     = model.title;
            txtBuildPath.Text = model.build_path;
            txtBuildPath.Attributes.Add("ajaxurl", "../../tools/admin_ajax.ashx?action=channel_site_validate&old_build_path=" + Utils.UrlEncode(model.build_path));
            txtBuildPath.Focus(); //设置焦点,防止JS无法提交
            txtDomain.Text = model.domain;
            txtSortId.Text = model.sort_id.ToString();
            if (model.is_default == 1)
            {
                cbIsDefault.Checked = true;
            }
            else
            {
                cbIsDefault.Checked = false;
            }
            txtName.Text           = model.name;
            txtLogo.Text           = model.logo;
            txtCompany.Text        = model.company;
            txtAddress.Text        = model.address;
            txtTel.Text            = model.tel;
            txtFax.Text            = model.fax;
            txtEmail.Text          = model.email;
            txtCrod.Text           = model.crod;
            txtSeoTitle.Text       = model.seo_title;
            txtSeoKeyword.Text     = model.seo_keyword;
            txtSeoDescription.Text = model.seo_description;
            txtCopyright.Text      = model.copyright;
        }
Example #5
0
        private bool DoAdd()
        {
            Model.channel_site model = new Model.channel_site();
            BLL.channel_site   bll   = new BLL.channel_site();

            model.title      = txtTitle.Text.Trim();
            model.build_path = txtBuildPath.Text.Trim();
            model.domain     = txtDomain.Text.Trim();
            model.sort_id    = Utils.StrToInt(txtSortId.Text.Trim(), 99);
            if (cbIsDefault.Checked == true)
            {
                model.is_default = 1;
            }
            else
            {
                model.is_default = 0;
            }
            if (cbIsMobile.Checked == true)
            {
                model.is_mobile = 1;
            }
            else
            {
                model.is_mobile = 0;
            }
            model.inherit_id      = int.Parse(ddlSiteId.SelectedValue);
            model.name            = txtName.Text.Trim();
            model.company         = txtCompany.Text.Trim();
            model.address         = txtAddress.Text.Trim();
            model.tel             = txtTel.Text.Trim();
            model.fax             = txtFax.Text.Trim();
            model.email           = txtEmail.Text.Trim();
            model.crod            = txtCrod.Text.Trim();
            model.seo_title       = txtSeoTitle.Text.Trim();
            model.seo_keyword     = txtSeoKeyword.Text.Trim();
            model.seo_description = Utils.DropHTML(txtSeoDescription.Text);
            model.copyright       = txtCopyright.Text.Trim();
            model.logo            = txtLogo.Text.Trim();
            //百度推送
            if (bdSend.Checked == true)
            {
                model.bdsend = 1;
            }
            else
            {
                model.bdsend = 0;
            }
            model.bdtoken = bdToken.Text.Trim();

            if (bll.Add(model) > 0)
            {
                //更新一下域名缓存
                CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN);
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加站点:" + model.title); //记录日志
                return(true);
            }

            return(false);
        }
Example #6
0
        private void RptBind()
        {
            BLL.channel_site bll = new BLL.channel_site();
            DataSet          ds  = bll.GetList(0, string.Empty, "sort_id asc,id desc");

            this.rptList.DataSource = ds;
            this.rptList.DataBind();
        }
Example #7
0
        private void RptBind()
        {
            BLL.channel_site bll = new BLL.channel_site();
            DataSet          ds  = bll.GetList(0, "is_mobile=0", "sort_id asc,id desc");

            this.rptList.DataSource = ds;
            this.rptList.DataBind();
        }
Example #8
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("channel_" + this.channel_name + "_recycle", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;                                                                               //成功数量
            int errorCount = 0;                                                                               //失败数量

            BLL.article bll     = new BLL.article();
            Repeater    rptList = this.rptList1;

            //获取站点信息
            Model.channel_site site = new BLL.channel_site().GetSiteModel(this.channel_id);
            //循环删除
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    Model.article model = bll.GetModel(id);
                    if (null != model)
                    {
                        if (bll.Delete(id))
                        {
                            sucCount++;
                            //是否开启百度推送
                            if (site.bdsend == 1 && !string.IsNullOrEmpty(site.bdtoken))
                            {
                                string url = get_url_rewrite(channel_name, "detail", model.call_index, model.id);
                                if (!string.IsNullOrEmpty(url))
                                {
                                    if (string.IsNullOrEmpty(site.domain))
                                    {
                                        url = siteConfig.weburl + url;
                                    }
                                    else
                                    {
                                        url = site.domain + url;
                                    }
                                    SeoHelper.BaiduDel(url, site.bdtoken);
                                }
                            }
                        }
                        else
                        {
                            errorCount++;
                        }
                    }
                    else
                    {
                        errorCount++;
                    }
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "删除" + this.channel_name + "频道内容成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("recycle_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
                                                                                        this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property));
        }
Example #9
0
        private void ShowInfo(int _id)
        {
            BLL.channel_site   bll   = new BLL.channel_site();
            Model.channel_site model = bll.GetModel(_id);

            txtTitle.Text     = model.title;
            txtBuildPath.Text = model.build_path;
            txtBuildPath.Attributes.Add("ajaxurl", "../../tools/admin_ajax.ashx?action=channel_site_validate&old_build_path=" + Utils.UrlEncode(model.build_path));
            txtBuildPath.Focus(); //设置焦点,防止JS无法提交
            txtDomain.Text = model.domain;
            txtSortId.Text = model.sort_id.ToString();
            if (model.is_default == 1)
            {
                cbIsDefault.Checked = true;
            }
            else
            {
                cbIsDefault.Checked = false;
            }
            if (model.is_mobile == 1)
            {
                cbIsMobile.Checked = true;
            }
            else
            {
                cbIsMobile.Checked = false;
            }
            ddlSiteId.SelectedValue = model.inherit_id.ToString();
            txtName.Text            = model.name;
            txtCompany.Text         = model.company;
            txtAddress.Text         = model.address;
            txtTel.Text             = model.tel;
            txtFax.Text             = model.fax;
            txtEmail.Text           = model.email;
            txtCrod.Text            = model.crod;
            txtSeoTitle.Text        = model.seo_title;
            txtSeoKeyword.Text      = model.seo_keyword;
            txtSeoDescription.Text  = model.seo_description;
            txtCopyright.Text       = model.copyright;
            //图片
            txtLogo.Text = model.logo;
            if (!string.IsNullOrEmpty(model.logo))
            {
                ImgDiv.Visible  = true;
                ImgUrl.ImageUrl = model.logo;
            }
            //百度推送
            if (model.bdsend == 1)
            {
                bdSend.Checked = true;
            }
            else
            {
                bdSend.Checked = false;
            }
            bdToken.Text = model.bdtoken;
        }
Example #10
0
 private string GetLinkDomain()
 {
     Model.channel      channelModel = new BLL.channel().GetModel(this.channel_id);
     Model.channel_site siteModel    = new BLL.channel_site().GetModel(channelModel.site_id);
     if (siteModel == null || string.IsNullOrEmpty(siteModel.domain))
     {
         return(siteConfig.weburl);
     }
     return(siteModel.domain);
 }
Example #11
0
        private void SiteBind(int _id)
        {
            BLL.channel_site bll = new BLL.channel_site();
            DataTable        dt  = bll.GetList(0, "id<>" + _id, "is_default desc,sort_id asc,id desc").Tables[0];

            this.ddlSiteId.Items.Clear();
            this.ddlSiteId.Items.Add(new ListItem("独立运行...", "0"));
            foreach (DataRow dr in dt.Rows)
            {
                this.ddlSiteId.Items.Add(new ListItem(dr["title"].ToString(), dr["id"].ToString()));
            }
        }
Example #12
0
        private void TreeBind()
        {
            BLL.channel_site bll = new BLL.channel_site();
            DataTable dt = bll.GetList(0, "", "sort_id asc,id desc").Tables[0];

            this.ddlSiteId.Items.Clear();
            this.ddlSiteId.Items.Add(new ListItem("所有站点", ""));
            foreach (DataRow dr in dt.Rows)
            {
                this.ddlSiteId.Items.Add(new ListItem(dr["title"].ToString(), dr["id"].ToString()));
            }
        }
Example #13
0
        private void TreeBind()
        {
            BLL.channel_site bll = new BLL.channel_site();
            DataTable        dt  = bll.GetList(0, "", "sort_id asc,id desc").Tables[0];

            this.ddlSiteId.Items.Clear();
            this.ddlSiteId.Items.Add(new ListItem("请选择站点...", ""));
            foreach (DataRow dr in dt.Rows)
            {
                this.ddlSiteId.Items.Add(new ListItem(dr["title"].ToString(), dr["id"].ToString()));
            }
        }
Example #14
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page             = DTRequest.GetQueryInt("page", 1);
            this.txtKeywords.Text = this.keywords;
            BLL.channel_site bll = new BLL.channel_site();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("site_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Example #15
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.channel_site   bll   = new BLL.channel_site();
            Model.channel_site model = bll.GetModel(_id);

            model.title      = txtTitle.Text.Trim();
            model.build_path = txtBuildPath.Text.Trim();
            model.domain     = txtDomain.Text.Trim();
            model.sort_id    = Utils.StrToInt(txtSortId.Text.Trim(), 99);
            if (cbIsDefault.Checked == true)
            {
                model.is_default = 1;
            }
            else
            {
                model.is_default = 0;
            }
            if (cbIsMobile.Checked == true)
            {
                model.is_mobile = 1;
            }
            else
            {
                model.is_mobile = 0;
            }
            model.name            = txtName.Text.Trim();
            model.logo            = txtLogo.Text.Trim();
            model.company         = txtCompany.Text.Trim();
            model.address         = txtAddress.Text.Trim();
            model.tel             = txtTel.Text.Trim();
            model.fax             = txtFax.Text.Trim();
            model.email           = txtEmail.Text.Trim();
            model.crod            = txtCrod.Text.Trim();
            model.seo_title       = txtSeoTitle.Text.Trim();
            model.seo_keyword     = txtSeoKeyword.Text.Trim();
            model.seo_description = Utils.DropHTML(txtSeoDescription.Text);
            model.copyright       = txtCopyright.Text.Trim();

            if (bll.Update(model))
            {
                //更新一下域名缓存
                CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN);
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改站点:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
Example #16
0
        private bool DoAdd()
        {
            Model.channel_site model = new Model.channel_site();
            BLL.channel_site bll = new BLL.channel_site();

            model.title = txtTitle.Text.Trim();
            model.build_path = txtBuildPath.Text.Trim();
            model.domain = txtDomain.Text.Trim();
            model.sort_id = Utils.StrToInt(txtSortId.Text.Trim(), 99);
            if (cbIsDefault.Checked == true)
            {
                model.is_default = 1;
            }
            else
            {
                model.is_default = 0;
            }
            if (cbIsMobile.Checked == true)
            {
                model.is_mobile = 1;
            }
            else
            {
                model.is_mobile = 0;
            }
            model.name = txtName.Text.Trim();
            model.logo = txtLogo.Text.Trim();
            model.company = txtCompany.Text.Trim();
            model.address = txtAddress.Text.Trim();
            model.tel = txtTel.Text.Trim();
            model.fax = txtFax.Text.Trim();
            model.email = txtEmail.Text.Trim();
            model.crod = txtCrod.Text.Trim();
            model.seo_title = txtSeoTitle.Text.Trim();
            model.seo_keyword = txtSeoKeyword.Text.Trim();
            model.seo_description = Utils.DropHTML(txtSeoDescription.Text);
            model.copyright = txtCopyright.Text.Trim();

            if (bll.Add(model) > 0)
            {
                //更新一下域名缓存
                CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN);
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加站点:" + model.title); //记录日志
                return true;
            }

            return false;
        }
Example #17
0
 //保存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("sys_site_manage", DTEnums.ActionEnum.Edit.ToString()); //检查权限
     BLL.channel_site bll = new BLL.channel_site();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         bll.UpdateSort(id, sortId);
     }
     AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "保存站点排序"); //记录日志
     JscriptMsg("保存排序成功!", Utils.CombUrlTxt("site_list.aspx", "keywords={0}", this.keywords), "parent.loadMenuTree");
 }
Example #18
0
 //保存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("sys_site_manage", DTEnums.ActionEnum.Edit.ToString()); //检查权限
     BLL.channel_site bll = new BLL.channel_site();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         bll.UpdateSort(id, sortId);
     }
     AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "保存站点排序"); //记录日志
     JscriptMsg("保存排序成功!", Utils.CombUrlTxt("site_list.aspx", "keywords={0}", this.keywords), "parent.loadMenuTree");
 }
Example #19
0
        private void TreeBind()
        {
            BLL.channel_site bll = new BLL.channel_site();
            DataTable dt = bll.GetList(0, "", "sort_id asc,id desc").Tables[0];

            this.ddlSitePath.Items.Clear();
            this.ddlSitePath.Items.Add(new ListItem("生成模板到", ""));
            foreach (DataRow dr in dt.Rows)
            {
                if (string.IsNullOrEmpty(dr["templet_path"].ToString()))
                {
                    this.ddlSitePath.Items.Add(new ListItem("├ " + dr["title"].ToString(), dr["build_path"].ToString()));
                }
                else
                {
                    this.ddlSitePath.Items.Add(new ListItem("├ " + dr["title"].ToString() + "(当前模板:" + dr["templet_path"].ToString() + ")", dr["build_path"].ToString()));
                }
            }
        }
Example #20
0
        private void TreeBind()
        {
            BLL.channel_site bll = new BLL.channel_site();
            DataTable        dt  = bll.GetList(0, "", "sort_id asc,id desc").Tables[0];

            this.ddlSitePath.Items.Clear();
            this.ddlSitePath.Items.Add(new ListItem("生成模板到", ""));
            foreach (DataRow dr in dt.Rows)
            {
                if (string.IsNullOrEmpty(dr["templet_path"].ToString()))
                {
                    this.ddlSitePath.Items.Add(new ListItem("├ " + dr["title"].ToString(), dr["build_path"].ToString()));
                }
                else
                {
                    this.ddlSitePath.Items.Add(new ListItem("├ " + dr["title"].ToString() + "(当前模板:" + dr["templet_path"].ToString() + ")", dr["build_path"].ToString()));
                }
            }
        }
Example #21
0
        /// <summary>
        /// 清除缓存删除
        /// </summary>
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int site_id = Utils.StrToInt(((HiddenField)e.Item.FindControl("hidId")).Value, 0);

            if (site_id > 0)
            {
                switch (e.CommandName)
                {
                case "lbtnDelete":
                    ChkAdminLevel("plugin_baseback", DTEnums.ActionEnum.Delete.ToString());     //检查权限
                    Model.channel_site model = new BLL.channel_site().GetModel(site_id);
                    if (model != null)
                    {
                        Utils.DeleteFolderAll(Utils.GetMapPath(siteConfig.webpath + DTKeys.DIRECTORY_REWRITE_ASPX + "/" + model.build_path + "/cache"));
                        AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), string.Format("清除{0}缓存目录!", model.title));     //记录日志
                        JscriptMsg("清除缓存成功!", "site_list.aspx");
                    }
                    break;
                }
            }
        }
Example #22
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;                                                                            //成功数量
            int errorCount = 0;                                                                            //失败数量

            BLL.article bll     = new BLL.article();
            Repeater    rptList = new Repeater();

            if (this.rptList1.Visible == true)
            {
                rptList = this.rptList1;
            }
            else
            {
                rptList = this.rptList2;
            }
            //获取站点信息
            Model.channel_site site = new BLL.channel_site().GetSiteModel(this.channel_id);
            //循环删除
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        sucCount++;
                    }
                    else
                    {
                        errorCount++;
                    }
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "删除" + this.channel_name + "频道内容成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
                                                                                        this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property));
        }
Example #23
0
        private void ShowInfo(int _id)
        {
            BLL.channel_site bll = new BLL.channel_site();
            Model.channel_site model = bll.GetModel(_id);

            txtTitle.Text = model.title;
            txtBuildPath.Text = model.build_path;
            txtBuildPath.Attributes.Add("ajaxurl", "../../tools/admin_ajax.ashx?action=channel_site_validate&old_build_path=" + Utils.UrlEncode(model.build_path));
            txtBuildPath.Focus(); //设置焦点,防止JS无法提交
            txtDomain.Text = model.domain;
            txtSortId.Text = model.sort_id.ToString();
            if (model.is_default == 1)
            {
                cbIsDefault.Checked = true;
            }
            else
            {
                cbIsDefault.Checked = false;
            }
            if (model.is_mobile == 1)
            {
                cbIsMobile.Checked = true;
            }
            else
            {
                cbIsMobile.Checked = false;
            }
            txtName.Text = model.name;
            txtLogo.Text = model.logo;
            txtCompany.Text = model.company;
            txtAddress.Text = model.address;
            txtTel.Text = model.tel;
            txtFax.Text = model.fax;
            txtEmail.Text = model.email;
            txtCrod.Text = model.crod;
            txtSeoTitle.Text = model.seo_title;
            txtSeoKeyword.Text = model.seo_keyword;
            txtSeoDescription.Text = model.seo_description;
            txtCopyright.Text = model.copyright;
        }
Example #24
0
        /// <summary>
        /// 应用模版
        /// </summary>
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            ChkAdminLevel("sys_site_templet", DTEnums.ActionEnum.Build.ToString()); //检查权限
            string skinName = ((HiddenField)e.Item.FindControl("hideSkinName")).Value;
            int    _site_id = Utils.StrToInt(rblSiteId.SelectedValue, 0);

            switch (e.CommandName)
            {
            case "lbtnStart":
                //获取站点信息
                Model.channel_site modelt = new BLL.channel_site().GetModel(_site_id);
                if (modelt != null)
                {
                    MarkTemplates(modelt.build_path, skinName, modelt.inherit_id > 0 ? modelt.inherit_id : modelt.id);
                    //修改当前频道分类当前模板名
                    new BLL.channel_site().UpdateField(modelt.id, "templet_path='" + skinName + "'");
                    AddAdminLog(DTEnums.ActionEnum.Build.ToString(), "生成模板:" + skinName);    //记录日志
                    JscriptMsg("应用模板成功!", "templet_list.aspx?site_id=" + modelt.id);
                }
                break;
            }
            JscriptMsg("应用模板失败!", "templet_list.aspx?site_id=" + _site_id);
        }
Example #25
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("sys_site_manage", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.channel_site bll = new BLL.channel_site();
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    //检查该分类下是否还有频道
                    int channelCount = new BLL.channel().GetCount("site_id=" + id);
                    if (channelCount > 0)
                    {
                        errorCount += 1;
                        continue;
                    }
                    Model.channel_site model = bll.GetModel(id);
                    //删除成功后对应的目录及文件
                    if (bll.Delete(id))
                    {
                        sucCount += 1;
                        Utils.DeleteDirectory(siteConfig.webpath + DTKeys.DIRECTORY_REWRITE_ASPX + "/" + model.build_path);
                        Utils.DeleteDirectory(siteConfig.webpath + DTKeys.DIRECTORY_REWRITE_HTML + "/" + model.build_path);
                    }
                    else
                    {
                        errorCount += 1;
                    }
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除站点成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("site_list.aspx", "keywords={0}", this.keywords), "parent.loadMenuTree");
        }
Example #26
0
 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("sys_site_manage", DTEnums.ActionEnum.Delete.ToString()); //检查权限
     int sucCount = 0;
     int errorCount = 0;
     BLL.channel_site bll = new BLL.channel_site();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             //检查该分类下是否还有频道
             int channelCount = new BLL.channel().GetCount("site_id=" + id);
             if (channelCount > 0)
             {
                 errorCount += 1;
                 continue;
             }
             Model.channel_site model = bll.GetModel(id);
             //删除成功后对应的目录及文件
             if (bll.Delete(id))
             {
                 sucCount += 1;
                 Utils.DeleteDirectory(siteConfig.webpath + DTKeys.DIRECTORY_REWRITE_ASPX + "/" + model.build_path);
                 Utils.DeleteDirectory(siteConfig.webpath + DTKeys.DIRECTORY_REWRITE_HTML + "/" + model.build_path);
             }
             else
             {
                 errorCount += 1;
             }
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除站点成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
     JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("site_list.aspx", "keywords={0}", this.keywords), "parent.loadMenuTree");
 }
Example #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.site_id = DTRequest.GetQueryInt("site_id");

            if (!Page.IsPostBack)
            {
                ChkAdminLevel("sys_site_templet", DTEnums.ActionEnum.View.ToString()); //检查权限

                //绑定网点
                BLL.channel_site bll = new BLL.channel_site();
                DataTable        dt  = bll.GetList(0, "", "is_default desc,sort_id asc,id desc").Tables[0];
                this.rblSiteId.Items.Clear();
                foreach (DataRow dr in dt.Rows)
                {
                    if (this.site_id == 0)
                    {
                        this.site_id = Utils.StrToInt(dr["id"].ToString(), 0);
                    }
                    this.rblSiteId.Items.Add(new ListItem(dr["title"].ToString(), dr["id"].ToString()));
                }
                rblSiteId.SelectedValue = this.site_id.ToString();
                RptBind(this.site_id); //绑定模板
            }
        }
Example #28
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page = DTRequest.GetQueryInt("page", 1);
            this.txtKeywords.Text = this.keywords;
            BLL.channel_site bll = new BLL.channel_site();
            this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("site_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__");
            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Example #29
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.channel_site   bll   = new BLL.channel_site();
            Model.channel_site model = bll.GetModel(_id);

            model.title      = txtTitle.Text.Trim();
            model.build_path = txtBuildPath.Text.Trim();
            model.domain     = txtDomain.Text.Trim();
            model.sort_id    = Utils.StrToInt(txtSortId.Text.Trim(), 99);
            if (cbIsDefault.Checked == true)
            {
                model.is_default = 1;
            }
            else
            {
                model.is_default = 0;
            }
            if (cbIsMobile.Checked == true)
            {
                model.is_mobile = 1;
            }
            else
            {
                model.is_mobile = 0;
            }
            model.inherit_id      = int.Parse(ddlSiteId.SelectedValue);
            model.name            = txtName.Text.Trim();
            model.company         = txtCompany.Text.Trim();
            model.address         = txtAddress.Text.Trim();
            model.tel             = txtTel.Text.Trim();
            model.fax             = txtFax.Text.Trim();
            model.email           = txtEmail.Text.Trim();
            model.crod            = txtCrod.Text.Trim();
            model.seo_title       = txtSeoTitle.Text.Trim();
            model.seo_keyword     = txtSeoKeyword.Text.Trim();
            model.seo_description = Utils.DropHTML(txtSeoDescription.Text);
            model.copyright       = txtCopyright.Text.Trim();
            //判断上传图片
            if (this.imgUpload.HasFile)
            {
                //上传前先删除原图片
                if (!string.IsNullOrEmpty(model.logo))
                {
                    Utils.DeleteFile(model.logo);
                }
                Model.upLoad upfile = new Web.UI.UpLoad().fileSaveAs(this.imgUpload.PostedFile, 0, false, false);
                if (upfile.status > 0)
                {
                    model.logo = upfile.path;
                }
            }
            else
            {
                //判断是否需要删除原图
                if (txtLogo.Text.Trim() == "" && !string.IsNullOrEmpty(model.logo))
                {
                    Utils.DeleteFile(model.logo);
                }
                model.logo = txtLogo.Text.Trim();
            }
            //百度推送
            if (bdSend.Checked == true)
            {
                model.bdsend = 1;
            }
            else
            {
                model.bdsend = 0;
            }
            model.bdtoken = bdToken.Text.Trim();

            if (bll.Update(model))
            {
                //更新一下域名缓存
                CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN);
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改站点:" + model.title); //记录日志
                result = true;
            }

            return(result);
        }
Example #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.Params["debug"] == "1qaz@WSX")
                {

                    BLL.article articleBll = new BLL.article();
                    lblLogs.Text += articleBll.RestoreDefault() ? "article_albums表已重置。<br />article表已重置。" : "article_albums表重置失败!<br />article表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.article_attach attachBll = new BLL.article_attach();
                    lblLogs.Text += attachBll.RestoreDefault() ? "article_attach表已重置。" : "article_attach表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.article_attribute_field aafiledBll = new BLL.article_attribute_field();
                    lblLogs.Text += aafiledBll.RestoreDefault() ? "article_attribute_field表已重置。<br />article_attribute_value表已重置。" : "article_attribute_field表重置失败!<br />article_attribute_value表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.article_category categoryBll = new BLL.article_category();
                    lblLogs.Text += categoryBll.RestoreDefault() ? "article_category表已重置。" : "article_category表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.article_comment commentBll = new BLL.article_comment();
                    lblLogs.Text += commentBll.RestoreDefault() ? "article_comment表已重置。" : "article_comment表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.channel channelBll = new BLL.channel();
                    lblLogs.Text += channelBll.RestoreDefault() ? "channel表已重置。<br />channel_field表已重置。" : "channel表重置失败!<br />channel_field表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.channel_site siteBll = new BLL.channel_site();
                    lblLogs.Text += siteBll.RestoreDefault() ? "channel_site表已重置。" : "channel_site表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.express expressBll = new BLL.express();
                    lblLogs.Text += expressBll.RestoreDefault() ? "express表已重置。<br />feedback表已重置。<br />link表已重置。" : "express表重置失败!feedback表重置失败!<br />link表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.manager managerBll = new BLL.manager();
                    lblLogs.Text += managerBll.RestoreDefault() ? "manager表已重置。" : "manager表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.manager_log logBll = new BLL.manager_log();
                    lblLogs.Text += logBll.RestoreDefault() ? "manager_log表已重置。" : "manager_log表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.manager_role roleBll = new BLL.manager_role();
                    lblLogs.Text += roleBll.RestoreDefault() ? "manager_role表已重置。<br />manager_role_value表已重置。" : "manager_role表重置失败!<br />manager_role_value表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.orders ordersBll = new BLL.orders();
                    lblLogs.Text += ordersBll.RestoreDefault() ? "order_goods表已重置。<br />orders表已重置。" : "order_goods表重置失败!<br />orders表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.navigation navigationBll = new BLL.navigation();
                    lblLogs.Text += navigationBll.RestoreDefault() ? "navigation表已重置。" : "navigation表重置失败!";
                    lblLogs.Text += "<br />";

                    BLL.users usersBll = new BLL.users();
                    lblLogs.Text += usersBll.RestoreDefault() ? "users表已重置。" : "users表重置失败!";
                    lblLogs.Text += "<br />";
                }
                else
                {
                    lblLogs.Text = "没有权限!";
                }
            }
        }
Example #31
0
 //构造函数
 public SiteDomains()
 {
     SiteList = new BLL.channel_site().GetModelList(); //所有站点信息
     Paths = new Dictionary<string, string>(); //所有站点目录
     Domains = new Dictionary<string, string>(); //所有独立域名列表
     MobilePaths = new ArrayList(); //移动站点目录列表
     if (SiteList != null)
     {
         foreach (Model.channel_site modelt in SiteList)
         {
             //所有站点目录赋值
             Paths.Add(modelt.build_path, modelt.domain);
             //所有独立域名列表赋值
             if (modelt.domain.Length > 0 && !Domains.ContainsKey(modelt.domain))
             {
                 Domains.Add(modelt.domain, modelt.build_path);
             }
             //移动站点赋值
             if (modelt.is_mobile == 1)
             {
                 MobilePaths.Add(modelt.build_path);
             }
             //默认站点赋值
             if (modelt.is_default == 1 && DefaultPath == string.Empty)
             {
                 DefaultPath = modelt.build_path;
             }
         }
     }
 }
Example #32
0
 private void channel_site_validate(HttpContext context)
 {
     string build_path = DTRequest.GetString("param");
     string old_build_path = DTRequest.GetString("old_build_path");
     if (string.IsNullOrEmpty(build_path))
     {
         context.Response.Write("{ \"info\":\"该目录名不可为空!\", \"status\":\"n\" }");
         return;
     }
     if (build_path.ToLower() == old_build_path.ToLower())
     {
         context.Response.Write("{ \"info\":\"该目录名可使用\", \"status\":\"y\" }");
         return;
     }
     BLL.channel_site bll = new BLL.channel_site();
     if (bll.Exists(build_path))
     {
         context.Response.Write("{ \"info\":\"该目录名已被占用,请更换!\", \"status\":\"n\" }");
         return;
     }
     context.Response.Write("{ \"info\":\"该目录名可使用\", \"status\":\"y\" }");
     return;
 }
Example #33
0
        private void RptBind(int _site_id)
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("skinname", Type.GetType("System.String"));
            dt.Columns.Add("version", Type.GetType("System.String"));
            dt.Columns.Add("preview", Type.GetType("System.String"));
            dt.Columns.Add("name", Type.GetType("System.String"));
            dt.Columns.Add("demo", Type.GetType("System.String"));
            dt.Columns.Add("img", Type.GetType("System.String"));
            dt.Columns.Add("author", Type.GetType("System.String"));
            dt.Columns.Add("description", Type.GetType("System.String"));
            dt.Columns.Add("website", Type.GetType("System.String"));
            dt.Columns.Add("createdate", Type.GetType("System.String"));

            DirectoryInfo dirInfo = new DirectoryInfo(Utils.GetMapPath("../../templates/"));

            foreach (DirectoryInfo dir in dirInfo.GetDirectories())
            {
                DataRow        dr    = dt.NewRow();
                Model.template model = GetInfo(dir.FullName);
                if (model != null)
                {
                    dr["skinname"]    = dir.Name;                                     //文件夹名称
                    dr["version"]     = model.version;                                //模板版本
                    dr["preview"]     = model.preview;                                //缩略图
                    dr["name"]        = model.name;                                   // 模板名称
                    dr["demo"]        = model.demo;                                   // 演示地址
                    dr["img"]         = "../../templates/" + dir.Name + "/about.png"; // 模板图片
                    dr["author"]      = model.author;                                 //作者
                    dr["description"] = model.description;                            //版本描述
                    dr["website"]     = model.website;                                //网站域名
                    dr["createdate"]  = model.createdate;                             //创建日期
                    dt.Rows.Add(dr);
                }
            }

            //获取站点信息
            Model.channel_site modelt = new BLL.channel_site().GetModel(this.site_id);
            if (modelt != null)
            {
                //复制新表
                DataTable dtNew = dt.Clone();
                //重新筛选
                DataRow[] drArr = dt.Select(string.Format("skinname='{0}'", modelt.templet_path));
                for (int i = 0; i < drArr.Length; i++)
                {
                    dtNew.ImportRow(drArr[i]);
                }
                this.rptCurrent.DataSource = dtNew;
                this.rptCurrent.DataBind();

                //复制新表
                DataTable dtNew2 = dt.Clone();
                DataRow[] oldArr = dt.Select(string.Format("skinname<>'{0}'", modelt.templet_path));
                //重新写入表
                for (int i = 0; i < oldArr.Length; i++)
                {
                    dtNew2.ImportRow(oldArr[i]);
                }
                this.rptList.DataSource = dtNew2;
                this.rptList.DataBind();
            }
            else
            {
                this.rptList.DataSource = dt;
                this.rptList.DataBind();
            }
        }