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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        public int UpdateUserInfo(Model.UserInformation cus)
        {
            string sql = "Update UserInformation set StateID=0";

            if (!string.IsNullOrEmpty(cus.Name))
            {
                sql += ",[Name]='" + cus.Name + "'";
            }
            if (!string.IsNullOrEmpty(cus.Password))
            {
                sql += ",[Password]='" + cus.Password + "'";
            }
            if (!string.IsNullOrEmpty(cus.loginName))
            {
                sql += ",[loginName]='" + cus.loginName + "'";
            }
            if (!string.IsNullOrEmpty(cus.Age))
            {
                sql += ",[Age]='" + cus.Age + "'";
            }
            if (!string.IsNullOrEmpty(cus.Gender))
            {
                sql += ",[Gender]='" + cus.Gender + "'";
            }
            if (!string.IsNullOrEmpty(cus.Telephone))
            {
                sql += ",[Telephone]='" + cus.Telephone + "'";
            }
            if (!string.IsNullOrEmpty(cus.qq))
            {
                sql += ",[qq]='" + cus.qq + "'";
            }
            if (!string.IsNullOrEmpty(cus.Mailbox))
            {
                sql += ",[Mailbox]='" + cus.Mailbox + "'";
            }
            sql += " where [UIID]='" + cus.UIID + "'";
            return(DbHelp.ExecQuery(sql));
        }
 /// <summary>
 /// 方法:获取图片的数量
 /// </summary>
 /// <returns></returns>
 public int selectPicture()
 {
     return((int)DbHelp.ExecScalar("select count(*) from vw_MovieType"));
 }
示例#6
0
 public int DeleteUserInfo(string id)
 {
     return(DbHelp.ExecQuery("Update [UserInformation] set delete=1 where [UIID] in (" + id + ")"));
 }
示例#7
0
 public int Userinformation(Model.UserInformation cus)
 {
     return(DbHelp.ExecQuery("insert into UserInformation values('" + cus.Name + "','" + cus.Password + "','" + cus.loginName + "','','','','','','','','')"));
 }