isgood.cs

来自「这个是个未完成品 演示地址:http://www.yyzyq.com 」· CS 代码 · 共 76 行

CS
76
字号
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// IsGoodPic 的摘要说明
/// </summary>
public class IsGood:SqlDataBase
{
	public IsGood()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}

    /// <summary>
    /// 首页图片视图
    /// </summary>
    /// <returns></returns>
    public DataView Dv_IsGood()
    {
        return GetDv("select * from IsGoodPic order by orderby,adddate desc");
    }

    
    /// <summary>
    /// 获取首页图片
    /// </summary>
    /// <returns></returns>
    public DataView Dv_IsGoodTop(string type)
    {
        return GetDv("select *,left(title,10) as titles from IsGoodPic where type="+type+" order by orderby");
    }

    /// <summary>
    /// 添加首页图片链接
    /// </summary>
    /// <param name="title">标题</param>
    /// <param name="pic">图片地址</param>
    /// <param name="url">连接地址</param>
    /// <param name="type">类型:0为图片、1为Flash游戏</param>
    public void AddIsGood(string title, string pic, string url, string type)
    {
        string strSql = "insert into IsGoodPic(title,pic,url,type)values('" + title + "','" + pic + "','" + url + "','" + type + "')";
        RunSql(strSql);
    }

    /// <summary>
    /// 删除首页图片连接
    /// </summary>
    /// <param name="id">ID</param>
    public void DelIsGood(string id)
    {
        string strSql = "delete IsGoodPic where id = " + id;
        RunSql(strSql);
    }

    /// <summary>
    /// 修改图片排序
    /// </summary>
    /// <param name="id">ID</param>
    /// <param name="order">排序</param>
    public void ChangeIsGoodOrder(string id,string order)
    {
        string strSql = "update IsGoodPic set orderby = " + order + " where id =" + id;
        RunSql(strSql);
    }
}

⌨️ 快捷键说明

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