using System; using System.Data; using System.Data.Common; using System.Collections; using System.Collections.Generic; using System.Text; using DSWeb.MvcShipping.Models.MsMessTip; using DSWeb.MvcShipping.Models.MsTemplet; using Microsoft.Practices.EnterpriseLibrary.Data; using DSWeb.EntityDA; using DSWeb.Areas.CommMng.Models; using HcUtility.Comm; using System.Data.SqlClient; using System.IO; using HcUtility.Core; using DSWeb.Areas.CommMng.DAL; namespace DSWeb.MvcShipping.DAL.MsWebSite { public class MsWebSiteDAL { #region 查询模板地址 public static List GetTempletURL(string gid) { List list = new List(); StringBuilder sql = new StringBuilder(); //sql.AppendLine("select top 1 TEMPLETURL from templet where TEMPLETID='" + gid + "'"); sql.AppendLine("select distinct GID,MAINIMGURL "); sql.AppendLine("from templet "); sql.AppendLine("where TEMPLETID='" + gid + "' "); Database db = DatabaseFactory.CreateDatabase(); using (IDataReader reader = db.ExecuteReader(CommandType.Text, sql.ToString())) { while (reader.Read()) { MsTempletStructure data = new MsTempletStructure(); data.GID = Convert.ToString(reader["GID"]); data.MAINIMGURL = Convert.ToString(reader["MAINIMGURL"]); list.Add(data); } reader.Close(); } return list; } #endregion #region 查询网址 public static List GetWebSite(string id) { List list = new List(); StringBuilder sql = new StringBuilder(); sql.AppendLine("select MAINIMGURL from templet where GID='" + id + "'"); Database db = DatabaseFactory.CreateDatabase(); using (IDataReader reader = db.ExecuteReader(CommandType.Text, sql.ToString())) { while (reader.Read()) { MsTempletStructure data = new MsTempletStructure(); data.MAINIMGURL = Convert.ToString(reader["MAINIMGURL"]); list.Add(data); } reader.Close(); } return list; } #endregion } }