Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //判断权限
            if (!CheckGrant(global::Common.Enum.TravelPermission.系统设置_同行平台栏目))
            {
                Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.系统设置_同行平台栏目, false);
                return;
            }

            if (!IsPostBack)
            {
                //初始化ssBLL
                EyouSoft.BLL.SiteStructure.SiteFriendLink ssBLL = new EyouSoft.BLL.SiteStructure.SiteFriendLink();
                //初始化Model
                EyouSoft.Model.SiteStructure.SiteFriendLink ssModel = new EyouSoft.Model.SiteStructure.SiteFriendLink();
                //////////////修改时加载原有数据
                if (Utils.GetQueryStringValue("type") == "modify")
                {
                    //获取id
                    id = Utils.GetInt(Utils.GetQueryStringValue("tid"));
                    //获取Model
                    ssModel = ssBLL.GetSiteFriendLink(id, SiteUserInfo.CompanyID);
                    //友情链接文字
                    txt_LinkName.Text = ssModel.LinkName;
                    //友情连接URL
                    txt_linkURL.Text = ssModel.LinkUrl;
                }
                ////////////////////////////////
            }
        }
Пример #2
0
        private void Save()
        {
            //初始化Model
            EyouSoft.Model.SiteStructure.SiteFriendLink ssModel = new EyouSoft.Model.SiteStructure.SiteFriendLink();
            //初始化BLL
            EyouSoft.BLL.SiteStructure.SiteFriendLink ssBLL = new EyouSoft.BLL.SiteStructure.SiteFriendLink();
            //判断操作
            if (Utils.GetQueryStringValue("type") == "modify")//修改操作
            {
                //获取id
                id = Utils.GetInt(Utils.GetQueryStringValue("tid"));
                //获取Model
                ssModel = ssBLL.GetSiteFriendLink(id, SiteUserInfo.CompanyID);
            }
            else
            {
                //友情链接添加时间
                ssModel.CreateTime = DateTime.Now;
            }
            //公司编号
            ssModel.CompanyId = SiteUserInfo.CompanyID;
            //判断友情链接文字是否为空
            if (txt_LinkName.Text.Trim() == "")
            {
                MessageBox.ResponseScript(this, ";alert('友情链接文字不能为空!');");
            }
            //友情链接文字赋值
            ssModel.LinkName = Utils.EditInputText(txt_LinkName.Text);
            //友情链接URL
            ssModel.LinkUrl = Utils.EditInputText(txt_linkURL.Text);
            //友情链接类型
            ssModel.LinkType = EyouSoft.Model.EnumType.SiteStructure.LinkType.文字;
            //数据 保存是否成功,默认保存失败
            bool res = false;

            //判断添加或修改
            if (id > 0)
            {
                res = ssBLL.UpdateFriendLink(ssModel);
            }
            else
            {
                res = ssBLL.AddFriendLink(ssModel);
            }
            //判断添加或修改成功否
            if (res)
            {
                /////////////////////////保存成功

                MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide();{2}", "保存成功!", Utils.GetQueryStringValue("iframeId"), id > 0 ? "window.parent.location.reload();" : "window.parent.location.href='/systemset/ToGoTerrace/FriendshipLink.aspx';"));

                ////////////////////////////////////////////
            }
            else
            {
                MessageBox.ResponseScript(this, ";alert('保存失败!');");
            }
        }
Пример #3
0
        /// <summary>
        /// 删除数据
        /// </summary>
        private void AreaDel()
        {
            //友情链接BLL
            EyouSoft.BLL.SiteStructure.SiteFriendLink ssBLL = new EyouSoft.BLL.SiteStructure.SiteFriendLink();
            //删除记录ID数组
            string[] stid = Utils.GetFormValue("tid").Split(',');
            int[]    tid  = new int[stid.Length];
            //循环添加删除ID
            for (int i = 0; i < stid.Length; i++)
            {
                tid[i] = Utils.GetInt(stid[i]);
            }
            //默认删除失败
            bool res = false;

            //删除记录
            res = ssBLL.DelFriendLink(tid[0], SiteUserInfo.CompanyID);
            Response.Clear();
            Response.Write(string.Format("{{\"res\":{0}}}", res ? 1 : -1));
            Response.End();
        }
Пример #4
0
 private void Bind()
 {
     //友情链接BLL
     EyouSoft.BLL.SiteStructure.SiteFriendLink ssBLL = new EyouSoft.BLL.SiteStructure.SiteFriendLink();
     //友情链接Model
     EyouSoft.Model.SiteStructure.SiteFriendLink ssModel = new EyouSoft.Model.SiteStructure.SiteFriendLink();
     //获取友情链接列表
     list = ssBLL.GetSiteFriendLink(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount);
     //判断列表条数
     if (list != null && list.Count > 0)
     {
         rptList.DataSource = list;
         rptList.DataBind();
         this.lblMsg.Visible = false;
     }
     else
     {
         this.ExporPageInfoSelect1.Visible = false;
         this.lblMsg.Visible = true;
     }
     BindPage();
 }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (CompanyId == 0)
                {
                    EyouSoft.Model.SysStructure.SystemDomain domain = new EyouSoft.BLL.SysStructure.SystemDomain().GetDomain(Request.Url.Host.ToLower());
                    CompanyId = domain.CompanyId;
                }

                //获得基本设置实体
                EyouSoft.Model.SiteStructure.SiteBasicConfig configModel = new EyouSoft.BLL.SiteStructure.SiteBasicConfig().GetSiteBasicConfig(CompanyId);
                if (configModel != null)
                {
                    this.lclFooter.Text = configModel.Copyright;
                }

                //获得友情链接
                int recordCount = 0;
                IList <EyouSoft.Model.SiteStructure.SiteFriendLink> linkList = new EyouSoft.BLL.SiteStructure.SiteFriendLink().GetSiteFriendLink(CompanyId, 10, 1, ref recordCount);
                this.rptLinkList.DataSource = linkList;
                this.rptLinkList.DataBind();
            }
        }