component/News.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections ;

namespace Hr.component
{
	public class News:DatabaseOperation
	{
		public News()
		{
		}

		public static DataSet GetNews()
		{
			strSQL = "SELECT * FROM news";
			try
			{
				return ExecuteReturnDS(strSQL);				
			}
			catch
			{
				throw new Exception("获取所有新闻信息失败!");
			}			
		}
		
		public DataView GetNewsPicture(int newsId)
		{
			String strsql;
			DataSet myDs;
			strsql="select picture from news where Id="+newsId;
			myDs=ExecuteReturnDS(strsql);
			return myDs.Tables[0].DefaultView ;
		}

		public DataView GetNewsLatest10()
		{
			String strsql;
			DataSet myDs;
			strsql="select top 10 Id,title from news order by Id DESC";
			myDs=ExecuteReturnDS(strsql);
			return myDs.Tables[0].DefaultView ;
		}
		

		public DataView GetNewsImportant10()
		{
			String strsql;
			DataSet myDs;
			strsql="select top 10 Id,title from news order by hits desc";
			myDs=ExecuteReturnDS(strsql);
			return myDs.Tables[0].DefaultView ;
		}

		public void AddNews(ArrayList tempary)
		{
			SqlConnection myConn=new SqlConnection(strConn);
			SqlCommand myCm=new SqlCommand("AddNews",myConn);
			myCm.CommandType =CommandType.StoredProcedure ;

后面还有 134 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。