示例#1
0
        public MySqlDataReader ReturnAddressInfo(HomeFeature Obj)
        {
            string Query = "SELECT * FROM address WHERE address_id = '" + Obj.address + "' ";
            string ConnectionString = ConfigurationManager.ConnectionStrings["TimeShareConnection"].ConnectionString;
            MySqlConnection Connection = new MySqlConnection(ConnectionString);
            MySqlCommand Command = new MySqlCommand(Query, Connection);
            Connection.Open();

            MySqlDataReader Reader = Command.ExecuteReader();

            return Reader;
        }
        public MySqlDataReader ReturnConditionInfoByHomeFeatureId(HomeFeature Obj)
        {
            string Query = "SELECT * FROM home_condition WHERE home_feature_id = '" + Obj.home_feature_id + "' ";
            string ConnectionString = ConfigurationManager.ConnectionStrings["TimeShareConnection"].ConnectionString;
            MySqlConnection Connection = new MySqlConnection(ConnectionString);
            MySqlCommand Command = new MySqlCommand(Query, Connection);
            Connection.Open();

            MySqlDataReader Reader = Command.ExecuteReader();

            return Reader;
        }
示例#3
0
        public Int32 InsertHomeFeatureData(HomeFeature Obj)
        {
            string Query = "INSERT INTO home_feature (name, price, address, no_of_room, area, baths, beds, garages, description, photo1, photo2, photo3, photo4) VALUES ('" + Obj.name + "', '" + Obj.price + "', '" + Obj.address + "', '" + Obj.no_of_room + "', '" + Obj.area + "', '" + Obj.baths + "', '" + Obj.beds + "', '" + Obj.garages + "', '" + Obj.description + "', '" + Obj.photo1 + "', '" + Obj.photo2 + "', '" + Obj.photo3 + "', '" + Obj.photo4 + "')";
            string Query2 = "SELECT LAST_INSERT_ID()";
            string ConnectionString = ConfigurationManager.ConnectionStrings["TimeShareConnection"].ConnectionString;
            MySqlConnection Connection = new MySqlConnection(ConnectionString);
            MySqlCommand Command = new MySqlCommand(Query, Connection);
            MySqlCommand Command2 = new MySqlCommand(Query2, Connection);
            Connection.Open();

            Command.ExecuteNonQuery();
            Int32 InsertedId = Convert.ToInt32(Command2.ExecuteScalar());

            return InsertedId;
        }