Esempio n. 1
0
        private bool DoEdit(string _urlName)
        {
            BLL.url_rewrite   bll   = new BLL.url_rewrite();
            Model.url_rewrite model = bll.GetInfo(_urlName);

            model.type    = ddlType.SelectedValue;
            model.channel = ddlChannel.SelectedValue;
            model.page    = txtPage.Text.Trim();
            model.inherit = txtInherit.Text.Trim();
            model.templet = txtTemplet.Text.Trim();
            //添加URL重写节点
            List <Model.url_rewrite_item> items = new List <Model.url_rewrite_item>();

            string[] itemPathArr        = Request.Form.GetValues("itemPath");
            string[] itemPatternArr     = Request.Form.GetValues("itemPattern");
            string[] itemQuerystringArr = Request.Form.GetValues("itemQuerystring");
            if (itemPathArr != null && itemPatternArr != null && itemQuerystringArr != null)
            {
                for (int i = 0; i < itemPathArr.Length; i++)
                {
                    items.Add(new Model.url_rewrite_item {
                        path = itemPathArr[i], pattern = itemPatternArr[i], querystring = itemQuerystringArr[i]
                    });
                }
            }
            model.url_rewrite_items = items;

            if (bll.Edit(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改URL配置信息:" + model.name); //记录日志
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        //查找匹配的URL
        private string get_url_rewrite(int channel_id, string call_index, int id)
        {
            if (channel_id == 0)
            {
                return(string.Empty);
            }
            string querystring  = id.ToString();
            string channel_name = new BLL.channel().GetChannelName(channel_id);

            if (string.IsNullOrEmpty(channel_name))
            {
                return(string.Empty);
            }
            if (!string.IsNullOrEmpty(call_index))
            {
                querystring = call_index;
            }
            BLL.url_rewrite   bll   = new BLL.url_rewrite();
            Model.url_rewrite model = bll.GetInfo(channel_name, "detail");
            if (model != null)
            {
                return(linkurl(model.name, querystring));
            }
            return(string.Empty);
        }
Esempio n. 3
0
File: search.cs Progetto: egojit/B2C
 //查找匹配的URL
 private string get_url_rewrite(string channel_id, int id)
 {
     BLL.url_rewrite bll = new BLL.url_rewrite();
     Model.url_rewrite model = bll.GetInfo(channel_id, "detail");
     if (model != null)
     {
         return linkurl(model.name, id);
     }
     return "";
 }
Esempio n. 4
0
 //查找匹配的URL
 private string get_url_rewrite(string channel_id, int id)
 {
     BLL.url_rewrite   bll   = new BLL.url_rewrite();
     Model.url_rewrite model = bll.GetInfo(channel_id, "detail");
     if (model != null)
     {
         return(linkurl(model.name, id));
     }
     return("");
 }
 private bool DoEdit(string _urlName)
 {
     BLL.url_rewrite bll = new BLL.url_rewrite();
     Model.url_rewrite model = bll.GetInfo(_urlName);
     model.name = txtName.Text.Trim();
     model.path = txtPath.Text.Trim();
     model.pattern = txtPattern.Text.Trim();
     model.page = txtPage.Text.Trim();
     model.querystring = txtQueryString.Text.Trim();
     model.templet = txtTemplet.Text.Trim();
     model.channel = txtChannel.Text.Trim();
     model.type = ddlType.SelectedValue;
     model.inherit = txtInherit.Text.Trim();
     return bll.Edit(model);
 }
 private void ShowInfo(string _urlName)
 {
     BLL.url_rewrite bll = new BLL.url_rewrite();
     Model.url_rewrite model = bll.GetInfo(_urlName);
     txtName.Text = model.name;
     txtName.ReadOnly = true;
     txtPath.Text = model.path;
     txtPattern.Text = model.pattern;
     txtPage.Text = model.page;
     txtQueryString.Text = model.querystring;
     txtTemplet.Text = model.templet;
     txtChannel.Text = model.channel;
     ddlType.SelectedValue = model.type;
     txtInherit.Text = model.inherit;
 }
 private bool DoEdit(string _urlName)
 {
     BLL.url_rewrite   bll   = new BLL.url_rewrite();
     Model.url_rewrite model = bll.GetInfo(_urlName);
     model.name        = txtName.Text.Trim();
     model.path        = txtPath.Text.Trim();
     model.pattern     = txtPattern.Text.Trim();
     model.page        = txtPage.Text.Trim();
     model.querystring = txtQueryString.Text.Trim();
     model.templet     = txtTemplet.Text.Trim();
     model.channel     = txtChannel.Text.Trim();
     model.type        = ddlType.SelectedValue;
     model.inherit     = txtInherit.Text.Trim();
     return(bll.Edit(model));
 }
 private void ShowInfo(string _urlName)
 {
     BLL.url_rewrite   bll   = new BLL.url_rewrite();
     Model.url_rewrite model = bll.GetInfo(_urlName);
     txtName.Text          = model.name;
     txtName.ReadOnly      = true;
     txtPath.Text          = model.path;
     txtPattern.Text       = model.pattern;
     txtPage.Text          = model.page;
     txtQueryString.Text   = model.querystring;
     txtTemplet.Text       = model.templet;
     txtChannel.Text       = model.channel;
     ddlType.SelectedValue = model.type;
     txtInherit.Text       = model.inherit;
 }
        private void ShowInfo(string _urlName)
        {
            BLL.url_rewrite bll = new BLL.url_rewrite();
            Model.url_rewrite model = bll.GetInfo(_urlName);

            txtName.Text = model.name;
            txtName.ReadOnly = true;
            ddlType.SelectedValue = model.type;
            ddlChannel.SelectedValue = model.channel;
            txtPage.Text = model.page;
            txtInherit.Text = model.inherit;
            txtTemplet.Text = model.templet;
            //绑定URL配置列表
            rptList.DataSource = model.url_rewrite_items;
            rptList.DataBind();
        }
Esempio n. 10
0
        private void ShowInfo(string _urlName)
        {
            BLL.url_rewrite   bll   = new BLL.url_rewrite();
            Model.url_rewrite model = bll.GetInfo(_urlName);

            txtName.Text             = model.name;
            txtName.ReadOnly         = true;
            ddlType.SelectedValue    = model.type;
            ddlChannel.SelectedValue = model.channel;
            txtPage.Text             = model.page;
            txtInherit.Text          = model.inherit;
            txtTemplet.Text          = model.templet;
            //绑定URL配置列表
            rptList.DataSource = model.url_rewrite_items;
            rptList.DataBind();
        }
Esempio n. 11
0
        /// <summary>
        /// 查找匹配的URL
        /// </summary>
        /// <param name="channel_id">频道ID</param>
        /// <param name="call_index">调用名</param>
        /// <param name="id">ID</param>
        /// <returns></returns>
        public string get_url_rewrite(int channel_id, string type, int id)
        {
            string channel_name = new BLL.site_channel().GetChannelName(channel_id);
            string querystring  = id.ToString();

            if (string.IsNullOrEmpty(channel_name))
            {
                return(string.Empty);
            }
            BLL.url_rewrite   bll   = new BLL.url_rewrite();
            Model.url_rewrite model = bll.GetInfo(channel_name, type);
            if (model != null)
            {
                return(new BaseController().linkurl(model.name, querystring));
            }
            return(string.Empty);
        }
Esempio n. 12
0
        /// <summary>
        /// 查找匹配的URL
        /// </summary>
        /// <param name="channel_id">频道ID</param>
        /// <param name="call_index">调用名</param>
        /// <param name="id">ID</param>
        /// <returns></returns>
        public string get_url_rewrite(string channel_name, string type, string call_index, int id)
        {
            string querystring = id.ToString();

            if (string.IsNullOrEmpty(channel_name))
            {
                return(string.Empty);
            }
            if (!string.IsNullOrEmpty(call_index))
            {
                querystring = call_index;
            }
            BLL.url_rewrite   bll   = new BLL.url_rewrite();
            Model.url_rewrite model = bll.GetInfo(channel_name, type);
            if (model != null)
            {
                return(new BaseController().linkurl(model.name, querystring));
            }
            return(string.Empty);
        }
Esempio n. 13
0
        private bool DoEdit(string _urlName)
        {
            BLL.url_rewrite bll = new BLL.url_rewrite();
            Model.url_rewrite model = bll.GetInfo(_urlName);

            model.type = ddlType.SelectedValue;
            model.channel = ddlChannel.SelectedValue;
            model.page = txtPage.Text.Trim();
            model.inherit = txtInherit.Text.Trim();
            model.templet = txtTemplet.Text.Trim();
            //添加URL重写节点
            List<Model.url_rewrite_item> items = new List<Model.url_rewrite_item>();
            string[] itemPathArr = Request.Form.GetValues("itemPath");
            string[] itemPatternArr = Request.Form.GetValues("itemPattern");
            string[] itemQuerystringArr = Request.Form.GetValues("itemQuerystring");
            if (itemPathArr != null && itemPatternArr != null && itemQuerystringArr != null)
            {
                for (int i = 0; i < itemPathArr.Length; i++)
                {
                    items.Add(new Model.url_rewrite_item { path = itemPathArr[i], pattern = itemPatternArr[i], querystring = itemQuerystringArr[i] });
                }
            }
            model.url_rewrite_items = items;

            if (bll.Edit(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改URL配置信息:" + model.name); //记录日志
                return true;
            }
            return false;
        }
Esempio n. 14
0
 //查找匹配的URL
 private string get_url_rewrite(int channel_id, string call_index, int id)
 {
     if (channel_id == 0)
     {
         return string.Empty;
     }
     string querystring = id.ToString();
     string channel_name = new BLL.channel().GetChannelName(channel_id);
     if (string.IsNullOrEmpty(channel_name))
     {
         return string.Empty;
     }
     if (!string.IsNullOrEmpty(call_index))
     {
         querystring = call_index;
     }
     BLL.url_rewrite bll = new BLL.url_rewrite();
     Model.url_rewrite model = bll.GetInfo(channel_name, "detail");
     if (model != null)
     {
         return linkurl(model.name, querystring);
     }
     return string.Empty;
 }