public List <RoomTypeInfo> getReservation(string id)
        {
            // kode get data from sql server..
            Koneksi             kon     = new Koneksi();
            SqlConnection       sqlcon  = kon.getConnection();
            List <RoomTypeInfo> objList = new List <RoomTypeInfo>();

            using (sqlcon)
            {
                sqlcon.Open();
                string     sql    = "select * from tb_room_type where id_room_type = @id";
                SqlCommand sqlcom = new SqlCommand(sql, sqlcon);
                using (sqlcom)
                {
                    sqlcom.Parameters.AddWithValue("@id", id);
                    SqlDataReader dr = sqlcom.ExecuteReader();
                    while (dr.Read())
                    {
                        RoomTypeInfo obj = new RoomTypeInfo();
                        obj.IDRoomType    = dr.GetString(1);
                        obj.TipeRoomType  = dr.GetString(2);
                        obj.PriceRoomType = (int)dr.GetInt64(3);
                        obj.InfoRoomType  = dr.GetString(4);
                        objList.Add(obj);
                    }
                }
                sqlcon.Close();
            }
            return(objList);
        }
        public List <RoomTypeInfo> getTotalRoomType()
        {
            // kode get data from sql server..
            Koneksi             kon     = new Koneksi();
            SqlConnection       sqlcon  = kon.getConnection();
            List <RoomTypeInfo> objList = new List <RoomTypeInfo>();

            using (sqlcon)
            {
                sqlcon.Open();
                string     sql    = "select b.name,COUNT(b.name) as jumlah from tb_room a inner join tb_room_type b on a.id_room_type = b.id_room_type where a.status = 'Available' group by b.name";
                SqlCommand sqlcom = new SqlCommand(sql, sqlcon);
                using (sqlcom)
                {
                    SqlDataReader dr = sqlcom.ExecuteReader();
                    while (dr.Read())
                    {
                        RoomTypeInfo obj = new RoomTypeInfo();
                        obj.TipeRoomType  = dr.GetString(0);
                        obj.TotalRoomType = (int)dr.GetInt32(1);
                        objList.Add(obj);
                    }
                }
                sqlcon.Close();
            }
            return(objList);
        }