public List <Model.PictureInformation> selectMovieINFO(string wherestr = null) { List <Model.PictureInformation> select = new List <Model.PictureInformation>(); if (DbHelp.OpenConnection()) { string sql = "select * from dbo.PictureInformation ORDER BY UpdateDate DESC"; SqlDataReader dr = DbHelp.ExecReader(sql); if (dr != null) { while (dr.Read()) { select.Add(new Model.PictureInformation((int)dr["MIID"], dr["PictureName"] as string, dr["Performer"] as string, dr["Region"] as string, (DateTime)dr["ParticularYear"], (DateTime)dr["UpdateDate"], dr["Plotintroduction"] as string, (int)dr["PictureNumber"], (int)dr["StateNameID"], (int)dr["LinkID"], (int)dr["Statname"], (int)dr["delete"], (int)dr["StateID"], dr["StateName"] as string)); } } DbHelp.CloseConnection(); } return(select); }
public List <Model.MovieInformation> selectMovie(string wherestr = null, int start = 1, int end = 90) { List <Model.MovieInformation> select = new List <Model.MovieInformation>(); if (DbHelp.OpenConnection()) { string sql = "select * from (select ROW_NUMBER() over (Order by MIID) as BID, * from vw_MovieType where [delete]=0" + wherestr + ")as c where c.BID between " + start + " and " + end; SqlDataReader dr = DbHelp.ExecReader(sql); if (dr != null) { while (dr.Read()) { select.Add(new Model.MovieInformation((int)dr["MIID"], dr["MovieName"] as string, dr["Performer"] as string, dr["Region"] as string, (DateTime)dr["ParticularYear"], (DateTime)dr["UpdateDate"], dr["Plotintroduction"] as string, (int)dr["PictureNumber"], (int)dr["StateNameID"], (int)dr["LinkID"], (int)dr["Statname"], (int)dr["delete"], (int)dr["StateID"], dr["StateName"] as string, dr["State"] as string, dr["ThunderboltLink"] as string, dr["BSL"] as string, dr["SDLP"] as string)); } } DbHelp.CloseConnection(); } return(select); }
public List <Model.UserInformation> GetUserInfo(string whereStr = null, int start = 1, int end = 10) { List <Model.UserInformation> customer = new List <Model.UserInformation>(); if (DbHelp.OpenConnection()) { SqlDataReader dr = DbHelp.ExecReader("select * from (select ROW_NUMBER() over (Order by UIID) as CusID, * from [UserInformation] where [delete]=0 " + whereStr + ") as c where c.CusID between " + start + " and " + end); if (dr != null) { while (dr.Read()) { customer.Add(new Model.UserInformation((int)dr["UIID"], dr["Name"] as string, dr["Password"] as string, dr["loginName"] as string, dr["Age"] as string, dr["Gender"] as string, dr["Telephone"] as string, dr["qq"] as string, dr["Mailbox"] as string, (int)dr["SecurityID"], (int)dr["delete"], (int)dr["StateID"])); } } DbHelp.CloseConnection(); } return(customer); }