日期:2014-05-16 浏览次数:20502 次
[WebMethod(Description = "查询主页新闻列表:HomeNew[] GetHomeNews(string BeginDate, string EndDate, string ReleaseMan, string PWD)")]
public HomeNew[] GetHomeNews(string BeginDate, string EndDate, string ReleaseMan, string PWD)
{
if (BeginDate == "" || EndDate == "") return null;
if (PWD.CompareTo("svtcc_xgsystem") == 0)
{
string StrSQL = @"select Id,NewsTitle,NewsFrom,InputDate,InputUser,Content,SystemId,AttachmentNum
from [dbo].[V_GetNews]
where PNodeNum='00800103' ";
if (BeginDate != "")
StrSQL += " and InputDate>='" + BeginDate + "' ";
if (EndDate != "")
StrSQL += " and InputDate<='" + EndDate + "' ";
if (ReleaseMan != "")
StrSQL += " and NewsFrom = '" + ReleaseMan + "' ";
StrSQL += " order by InputDate Desc ";
DataSet ds = DataAccess.GetResult(StrSQL);
DataRow dr;
if (ds.Tables[0].Rows.Count <= 0) return null;
HomeNew[] hn = new HomeNew[ds.Tables[0].Rows.Count];
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
dr = ds.Tables[0].Rows[i];
hn[i] = new HomeNew();
hn[i].Id = Convert.ToInt32(dr["Id"].ToString());
hn[i].NewsTitle = dr["NewsTitle"].ToString();