Beispiel #1
0
        //添加酒店信息
        public bool addHotelInfo(hotelInfo h /*酒店信息对象*/)
        {
            string sql = "insert into HotelInfo values('" + h.Hid + "','" + h.Hname + "','" + h.Hprovince + "','" + h.Haddress
                         + "'," + h.Hprice + ",'" + h.Hcontact + "','" + h.Hintroduce + "','" + h.HimageUrl + "')";
            int num = DatabaseLink.UpdateData(sql);

            if (num > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        //修改酒店信息
        public bool updateHotelInfo(hotelInfo h, string id /*酒店编号*/)
        {
            string sql = "update HotelInfo set Hname='" + h.Hname + "',Hprovince='" + h.Hprovince + "',Haddress='" + h.Haddress
                         + "',Hprice=" + h.Hprice + ",Hcontact='" + h.Hcontact + "',Hintroduce='" + h.Hintroduce + "',HimageUrl='" + h.HimageUrl
                         + "'  where Hid='" + id + "'";
            int num = DatabaseLink.UpdateData(sql);

            if (num > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }