⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hailfellowlink.aspx.cs

📁 易想商城系统
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Accessories
{
    public partial class HailFellowLink : System.Web.UI.Page
    {
        BasePage bp = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack && Request.QueryString["ID"] != null)
            {
                if (!PowerTree.PowerPass.isPass("013008004", PowerTree.PowerPanel.PowerType.update))
                {
                    bp = new BasePage();
                    bp.PageError("对不起,你没有修改友情链接的权限!", "../index.aspx");
                }
                YXShop.BLL.HailFellowLink datab = new YXShop.BLL.HailFellowLink();
                List<YXShop.Model.HailFellowLink> datam = datab.GetListByColumn("ID", Request.QueryString["ID"]);
                if (datam.Count > 0)
                {
                    this.tbSiteName.Text = datam[0].SiteName;
                    this.tbSiteUrl.Text = datam[0].SiteUrl;
                    this.tbSiteLogo.Text = datam[0].SiteLogo;
                    this.tbLevel.Text = datam[0].SiteLevel.ToString();
                    this.tbSiteSynopsis.Text = datam[0].SiteContent;
                    this.rbLinkType.SelectedValue = datam[0].SiteLinkType.ToString();
                    this.rbState.SelectedValue = datam[0].SiteState.ToString();
                    this.tbOnclick.Text = datam[0].SiteOnClick.ToString();
                }
                ViewState["URL"] = Request.UrlReferrer.ToString();
            }
            else 
            {
                if (!PowerTree.PowerPass.isPass("013008002", PowerTree.PowerPanel.PowerType.add))
                {
                    bp = new BasePage();
                    bp.PageError("对不起,你没有添加友情链接的权限!", "../index.aspx");
                }
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            YXShop.BLL.HailFellowLink datab = new YXShop.BLL.HailFellowLink();
            YXShop.Model.HailFellowLink datam = new YXShop.Model.HailFellowLink();
            datam.SiteName = this.tbSiteName.Text;
            datam.SiteUrl = this.tbSiteUrl.Text;
            datam.SiteLogo = this.tbSiteLogo.Text;
            datam.SiteLevel =Convert.ToInt32(this.tbLevel.Text);
            datam.SiteContent = this.tbSiteSynopsis.Text;
            datam.SiteLinkType = Convert.ToInt32(this.rbLinkType.SelectedValue);
            datam.SiteState = Convert.ToInt32(this.rbState.SelectedValue);
            datam.SiteOnClick = Convert.ToInt32(this.tbOnclick.Text);
            if (Request.QueryString["ID"] != null)
            {
                datam.ID = Convert.ToInt32(Request.QueryString["ID"]);
                datam.Update = System.DateTime.Now;
                if (datab.Amend(datam) > 0)
                {
                    bp = new BasePage();
                    bp.PageRight("友情链情修改成功。", "HailFellowLink.aspx");
                }
                tbSiteName.Text = string.Empty;
                tbSiteUrl.Text = string.Empty;
                tbSiteLogo.Text = string.Empty;
                this.tbLevel.Text = string.Empty;
                this.tbSiteSynopsis.Text = string.Empty;
                this.tbOnclick.Text = string.Empty;
            }
            else
            {
                if (datab.Create(datam) > 0)
                {
                    bp = new BasePage();
                    bp.PageRight("友情链接添成功。<li><a href='HailFellowLink.aspx'>继续添加</a></li>", "HailFellowLink.aspx");
                }
                tbSiteName.Text = string.Empty;
                tbSiteUrl.Text = string.Empty;
                tbSiteLogo.Text = string.Empty;
                this.tbLevel.Text = string.Empty;
                this.tbSiteSynopsis.Text = string.Empty;
                this.tbOnclick.Text = string.Empty;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -