Exemple #1
0
        public void AddPlace(Place p)
        {
            string  sql = "select top 1 * from place";
            DataSet ds  = db.GetDataSet(sql);
            DataRow dr  = ds.Tables[0].NewRow();

            dr["PlaceID"] = p.PlaceID;
            dr["Places"]  = p.Places;
            dr["Image"]   = p.Image;
            ds.Tables[0].Rows.Add(dr);
            db.UpdateDataset(sql, ds);
        }
Exemple #2
0
        //注册用户
        public void Register(Users u)
        {
            string  sql = "select top 1 * from Users";
            DataSet ds  = db.GetDataSet(sql);
            DataRow dr  = ds.Tables[0].NewRow();

            dr["Username"] = u.Username;
            dr["Password"] = u.Password;
            dr["Sex"]      = u.Sex;
            dr["RoleId"]   = u.RoleId;

            dr["Email"] = u.Email;
            ds.Tables[0].Rows.Add(dr);
            db.UpdateDataset(sql, ds);
        }
Exemple #3
0
        public void AddPlaceInfo(placeInfo p)
        {
            string  sql = "select top 1 * from PlaceInfo";
            DataSet ds  = db.GetDataSet(sql);
            DataRow dr  = ds.Tables[0].NewRow();

            dr["PlaceID"]      = p.PlaceID;
            dr["image"]        = p.Image;
            dr["title"]        = p.Title;
            dr["Introduction"] = p.Introduction;
            //dr["Price"] = p.Price;
            dr["Introduce"] = p.Introduce;
            //dr["Location"] = p.Location;
            //dr["Traffic"] = p.Traffic;
            //dr["Surrounding"] = p.Surrounding;
            //dr["Information"] = p.Information;
            //dr["Amenities"] = p.Amenities;
            //dr["Fee"] = p.Fee;
            //dr["Tip"] = p.Tip;
            ds.Tables[0].Rows.Add(dr);
            db.UpdateDataset(sql, ds);
        }